Changes in the JAWAA Editor
Version 2.1
Display Error for Invalid Name Changes (Blank, Begins with Digit, All Digits)
The Namespace would accept some names that were actually illegal in the JAWAA language. I added more error checking, and made the error messages specific so the user knows what's wrong.
name/Namespace
nameAcceptable()
return BLANK, BEGIN_DIGIT, ILLEGAL_CHAR, or ACCEPTABLE according to what the name contains
Added static final ints: NEW
ACCEPTABLE, BLANK, ILLEGAL_CHAR, BEGIN_DIGIT
gui/toolbar/NameChangeButton
changeName()
checks the name using constants from Namespace and displays the appropriate message depending on which constant is returned.
Allow Oval and Rectangular Node Buttons to show up (Unique KeyStrokes)
The reason why they were “hidden” before was because the Oval and Rectangular Node were different “modes” of the Circle and Circular Node. However, I did not realize this until reading the documentation. I feel like it was too subtle, and considering how few buttons there are, unnecessary.
tool/box/CircleTool
getSwitch()
VK_C changed to VK_O
tool/box/RectangularNodeTool
getSwitch()
VK_N changed to VK_G
Make default names for objects more specific
Objects were originally named “object1, object2” with no regard as to whether they were circles, rectangles, text, or whatever. I think it's important for the .anim file to output readable code, and having specific names helps that goal to happen.
object/DrawingObject
getName()
no longer final - instead of naming everything “object#”
object/NodeObject -> node#
object/box/CircleObject -> circ#
object/box/EdgeObject -> edge#
object/box/LineObject -> line#
object/box/OvalObject -> oval#
object/box/PolygonObject -> poly#
object/box/RectangleObject -> rect#
object/box/TextObject -> text#
getName()
Make key shortcuts [Ctrl] instead of [Meta]
The controls were originally [Meta] because JAWAA was built on a Mac. I'm just used to [Ctrl]. If someone wants to change it back, it's easy to do.
gui/menu/MenuConstants
initMainMenuMask()
META_MASK -> CTRL_MASK
Display the name of the selected object
I thought it would be nice for the user to be able to distinguish between objects by seeing their names displayed when they're selected.
gui/toolbar/ClassMatchToolbar
reviewContents()
if the object being added to the toolbar is a name, then check to see if only one object is selected
gui/PaintObjectBar
getActionMaskPairList()
calls addNameDisplay()
addNameDisplay() NEW
adds a name label to the toolbar
Make delete shortcut [DELETE] instead of [BACKSPACE]
Once again, probably just a Mac thing. Once again, you can change it back if you want.
gui/menu/EditMenu
initDelete() / initAnnihilate()
VK_BACK_SPACE -> VK_DELETE
Enable nodes to change default text color and size
Nodes could only have their default fill and line color set, so I added text color and point size to their default properties that could be changed.
tool/box/RectangularNodeTool
tool/box/CircularNodeTool
implements TextColorAcceptor
acceptTextColor() / getTextColor()
implements PointSizeChangeAcceptor
createObject() / acceptPointSize()
Enable text to change default point size
There was no way to change the default size of any text. I didn't want the incremental buttons displayed, but just the dialog box to enter a new point size.
tool/box/TextTool
implements PointSizeChangeAcceptor
acceptPointSize() / getPointSize()
accept/PointSizeChangeAcceptor NEW
PointSizeChangeAcceptor only accepts a direct point size change. It will not accept an incremental or decremental change. This is used for tools that will change the default text size.
accept/PointSizeAcceptor
extends PointSizeChangeAcceptor
(PointSizeAcceptor allows incremental change and direct change, PointSizeChangeAcceptor only allows direct change)
gui/PaintObjectBar
addTextButtons()
call PointSizeChangeButton(PointSizeChangeAcceptor). A PointSizeChange button can be added in situations when the Increment and Decrement buttons cannot (ie. default changes)
gui/toolbar/AbstractPointSizeChangeButton
Removed the action listener. This is so that the buttons can have different Acceptors.
gui/toolbar/PointSizeChangeButton
gui/toolbar/PointSizeDecrementButton
gui/toolbar/PointSizeIncrementButton
individual action listeners
constructor adds action listener
Enable Scaling
This is a tool which prompts the user to enter a percentage, then scales the object by that amount. This is different from resizing by the handles, because it outputs a “scale” command (which is smooth) instead of “changeParam” height or width (which is instant)
gui/toolbar/ScaleButton NEW
The ScaleButton prompts the user for a percentage to scale the selected object(s).
accept/ScaleAcceptor NEW
The ScaleAcceptor is an interface for objects that can be scaled.
object/RectangularBoundObject
implements ScaleAcceptor
scale() - changes the display of the object and enters a scale value into the RectangularBoundState
getWidth() / getHeight()
Used to calculate the amount that the scale must change.
object/RectangularBoundNodeObject
implements ScaleAcceptor
scale() - changes the display of the object and enters a scale value into the RectangularBoundState
getWidth() / getHeight()
Used to calculate the amount that the scale must change.
object/LineObject
implements ScaleAcceptor
scale() - changes the display of the object and enters a scale value into the LineState
getWidth() / getHeight()
Used to calculate the amount that the scale must change.
object/state/LineState
getScale() / setScale()
added field myScale
object/state/RectangularBoundState
getScale() / setScale()
added field myScale
command/generate/SquareBoundGenerator
checkScale() as part of checkSize()
utility/Percent NEW
calculatePercentage() <- given a value and a percent, return the percentage of that value. ie. 50% of 40 = 20
Add Array Data Structures
Arrays can be created and edited, and they will output initialization commands to the .anim file. However, there is a display problem in the JAWAA Editor, so that arrays do not show up, and they cannot be selected, except when you use [Ctrl] + A.
structure/box/ArrayStructure NEW
structure/state/ArrayState NEW
structure/CellObject NEW
tool/box/ArrayTool NEW
command/generate/StructureGenerator NEW
structure/DataStructure NEW
accept/OrientationAcceptor NEW
gui/toolbar/OrientationChangeButton NEW
gui/PaintObjectBar
addOrientationButtons()
Add Data Structure Arrow Selector
When using output to the console for debugging purposes, I could see that the structure selector would work if arrays were selectable (the selector was getting selectable bounds on the arrays, seeing if the point on the array was an active point, etc). I think that somehow the array does not exist at the present time. Perhaps that's why the transition commands don't work.
gui/toolbar/SelectorChangeButton NEW
from OrientationChangeButton
tool/box/ArrowSelectorTool NEW
implements SelectorChangeAcceptor
universe/Directory NEW
instead of ObjectDirectory, the Directory deals with both Objects and Structures
object/ContainerObject NEW
a Container is a general class for shapes with text inside them.
accept/SelectorChangeAcceptor NEW
the Interface for classes that change their selection state
Get Commands for Arrays
Arrays can output initialization commands into the .anim file, but transition commands are still not working. The array is initialized in its final state instead of its beginning state, which is not right.
command/generate/StructureGenerator
accepts DataStructures and should generate transition commands, but it seems like there is some sort of timing / state problem with Arrays (is that why they won't draw right?)
structure/box/ArrayStructure
getInitializationCommands() This works great except that the array is always initialized with the last state it was in instead of the first, so you don't see any of the changes over time.
object/CellObject
Initialization commands should not exist, since cells are initialized through their array. However, it looks like the transition commands are not working yet.
Add Handles to Arrays
I don't know if StructureHandle was the best idea. It's just that the Handle class doesn't recognize DataStructures, and I wasn't sure whether to add DataStructures to the existingHandle class, or to create a new Handle class.
object/StructureHandle
should be able to make handles for a DataStructure.
structure/box/ArrayStructure
changed Handle to StructureHandle
Suggested Future Work:
Make Arrays and Cells VISIBLE and SELECTABLE
Transition commands for arrays
Arrays output general commands
Cells output individual commands
Scale Text
Would require Text to be able to change size by a percentage
Scale Arrays
Would require Cells to scale and translate accordingly
Would also require Text to scale
Tree Tool
Draw Circular nodes in tree-like arrangement
Perhaps start with root, then add children to nodes as you go down
Selecting a node in a tree would allow you to add a child to that node (using a button in the PaintObjectBar)
Undo
Especially if you could “Undo” a deletion.
Toolbar
Two Toolbars at the top instead of one shared Toolbar so that there is more room to add buttons.
Known Errors:
Comodification Error
Sometimes, a Comodification error is displayed, especially when working with Arrays. I'm not sure what causes it, because I could repeat the same action, and the error would occur only once in a while.
NullPointerException with Polygons
If you create and then delete a polygon, then try to create a new polygon, a NullPointerException is thrown. I didn't do anything with the polygon classes, so I don't know how this bug got there.
Display and Selection Problem with Arrays and Cells
Arrays and Cells do not show on the canvas, although they are created within the program. Also, they cannot be selected unless you use [Ctrl] + A (“Select All”)
Command Output Problem with Arrays and Cells
Arrays do output initialization code, but right now the array is initialized in the last state in the Editor instead of the first state. Also, Arrays do not yet output transition code. Cells do not have initialization code, but it's hard to test their individual code when they can't be selected. I have gotten transition code for Cells a couple of times for text color change.