Skip to content

Commit

Permalink
Version v1.14
Browse files Browse the repository at this point in the history
This should finish the update. The changes here were entirely of documentation.
  • Loading branch information
mmoult committed Sep 25, 2021
1 parent 4ba00c4 commit fb68b16
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs/MenuComponents.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,4 @@ Although pop ups do not generally fit the mold of scalable components, there is

All pop ups must be descendants of the class `moulton.scalable.popups.Popup`. Due to the sheer number of possibilities and varying implementation strategies, said pop up parent class provides minimal features. These features include dimensions, the aforementioned Panel base, touchCheckList (which is a list structure of components that need to be checked for mouse interactivity), and a background color.

Two pop up subclasses have also been provided in the package to accomodate common usage. These are the aptly named `NotificationPopup` and `ConfirmationPopup`.
However, to accomodate typical usage, the `moulton.scalable.popups.CommonPopup` has been provided, with two subclass use cases, the `moulton.scalalable.popups.NotificationPopup` and the `moulton.scalalable.popups.ConfirmationPopup`. As their names would suggest, use the NotificationPopup for basic notification functionality, and the ConfirmationPopup when the user needs to either accept or reject some message.
15 changes: 12 additions & 3 deletions src/moulton/scalable/popups/CommonPopup.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@
import moulton.scalable.texts.Caption;
import moulton.scalable.texts.LineBreak;

/**
* A great deal of pop ups require the same basic functionality. Therefore, this abstract
* common pop up superclass is provided. CommonPopup allows for the basic structure of a
* pop up with a title, exit button, and main text.
* <p>
* For more extensive functionality, it is recommended to use or subclass
* {@link NotificationPopup} or {@link ConfirmationPopup}.
* @author Matthew Moulton
*/
public abstract class CommonPopup extends Popup {

/**
Expand Down Expand Up @@ -148,7 +157,7 @@ private void init(String text, String title, Font font, boolean exitButton, Stri
}

/**
* This is used by {@link #init(String, String, String, String, Font, boolean, boolean)} to
* This is used by {@link #init(String, String, Font, boolean, String, MenuManager)} to
* find the default width of the pop up if the text is not too long.
* @param fontHeight the height of the font given in the constructor
* @return an integer number of pixels that should be used as the default pop up width
Expand All @@ -158,7 +167,7 @@ public int getPopupDefaultWidth(int fontHeight) {
}

/**
* This is used by {@link #init(String, String, String, String, Font, boolean, boolean)} to
* This is used by {@link #init(String, String, Font, boolean, String, MenuManager)} to
* find the maximum width of the pop up. If the text is too long to fit in the
* {@link #getPopupDefaultWidth(int)}, then the width of the pop up will be extended to
* accommodate it. However, this is the limit to such extension.
Expand All @@ -170,7 +179,7 @@ public int getPopupMaxWidth(int fontHeight) {
}

/**
* This is used by {@link #init(String, String, String, String, Font, boolean, boolean)} to
* This is used by {@link #init(String, String, Font, boolean, String, MenuManager)} to
* find the height of the pop up. This is extra height after the title and text have been
* accounted for.
* @param fontHeight the height of the font given in the constructor
Expand Down
2 changes: 1 addition & 1 deletion src/moulton/scalable/popups/ConfirmationPopup.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/**
* This is an example of what can be done with pop ups. Sometimes the user needs to choose between two options
* before they proceed to the next action, and this pop up fulfills this purpose. For greater flexibility,
* subclass this and override {@link #init(String, String, String, Font, boolean)}.
* subclass this and override {@link #init(String, String, Font, MenuManager, boolean)}.
* @author Matthew Moulton
*/
public class ConfirmationPopup extends CommonPopup {
Expand Down
7 changes: 3 additions & 4 deletions src/moulton/scalable/popups/NotificationPopup.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@
import moulton.scalable.containers.MenuManager;

/**
* This is an example of what can be done with pop ups. Sometimes the user needs to be notified of some event
* or information before they proceed to the next action, and this pop up fulfills this purpose. Admittedly
* its design does not allow for much flexibility: the constructor calls an init method that creates the
* contents of the pop up on its base panel.
* This is an example of what can be done with pop ups. Sometimes the user needs to be notified of some
* event or information before they proceed to the next action, and this pop up fulfills this purpose.
* The constructor calls an init method that creates the contents of the pop up on its base panel.
* @author Matthew Moulton
*/
public class NotificationPopup extends CommonPopup {
Expand Down
14 changes: 14 additions & 0 deletions src/moulton/scalable/utils/ExpressionSolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,21 @@
* @author Matthew Moulton
*/
public class ExpressionSolver {
/**
* The variables that have meaning in the context of menu expressions. The variables provided
* by default are
* <ul>
* <li>centerx
* <li>centery
* <li>width>
* <li>height
* <li>pi
* <li>e
* </ul>
* The corresponding values are saved in {@link #values}
*/
protected String[] variables = {"centerx", "centery", "width", "height", "pi", "e"};
/**The values that correspond to the {@link #variables}.*/
protected double[] values;

/**
Expand Down

0 comments on commit fb68b16

Please sign in to comment.