Graphics Reference
In-Depth Information
ent behavior depending on the object selected by the state field. Figure . and
. partly show these relations.
he SelectingState class can select observations. It draws a selector at the
positionspecified bya mousePressed event. mouseDragged eventscanchange
thesizeoftheselector.A mouseReleased eventselectstheobservations insidethe
selector;moreprecisely,a mouseReleased eventgeneratesa PlotModelEvent
object, sets the information of selected observations to it, and sends the object to the
PlotModelHandler object to repaint the graphics.
he BrushingState classinheritsthe SelectingState class,andhasadif-
ferent implementation for handling a mouseDragged event. In the Brushing-
State class, mouseDragged events cause the same behavior as the mouse-
Released event in the SelectingState class.
he DraggingState class enables the movement of selected observations by
draggingtheselector.hisoperationchangesthevaluesofselectedobservationstem-
porarily. he resetDragging method can recover their original values again.
he ManipulatingState class can reverse the directions of the x and y axes.
When this class is set to the state field in the JasplotPanelDragLayerUI
class, a frame appears around the graphic and this can be used to specify the direc-
tions of the axes.
he MultiPlotManipulatingState class is available for graphics placed
bythe MultiPlotModel classthatisexplainedinSect. . . later.Itworkslikethe
ManipulatingState class and can swap the locations of graphics by dragging
an accompanying frame.
he ZoomingState classisusedtozoomtheregionthatisspecifiedbythe
mousePressed and mouseReleased events.he resetZooming methodcan
reset the operation to the original size.
In Jasplot, strings drawn on graphics can show tooltips, which are small pop-up
windows to show strings. hey are useful, for example, for showing each variable
name clearly when several variable names overlap and are di cult to identify on
the original graphics. We can see each variable name by placing the mouse cur-
sor on the variable name strings and presenting a tooltip on which the specified
variable name is displayed. his function is realized by the ToolTipState class.
he BasicPlotter class has several methods to draw strings on graphics such
as drawStringCenter and drawStringLeftUpper .Whenweusethem,
the BasicPlotter class records the position of the strings as a pair consisting
of a Rectangle2D object and a String object. he mouseMoved method in
the ToolTipState class can check whether the position of the mouse cursor is
inside that Rectangle2D object or not. If the mouse cursor is inside one of these
Rectangle2D objects,thecorresponding String objectisdisplayedbythe set-
ToolTipText method in the JasplotPanel object.
Drag & drop operations are also available for strings on graphics using the
DragGestureState class. Strings can be dragged and dropped onto graphics
components defined by the DroppableTextField and DroppableCombo-
Box classes. his function can be used to specify a variable name on a graphic by
performing a drag & drop operation for a variable name on another graphic.
Search WWH ::




Custom Search