|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--fdda.dialog.java2d.Java2DControl
Controls the graphics of the java2d component. That is, it performs the actions requested by the user through menus or mouse manipulation, partly by delegating them to a manipulator. Also controls the automatic painting of the graphical system and its zoom.
Nested Class Summary | |
(package private) class |
Java2DControl.ZoomablePanel
A panel that can be zoomed using an AffineTransform |
Field Summary | |
static Color |
GREY
the color grey |
static double |
ZOOM_OUT_SCALE
scale factor for one zoom out operation. |
Fields inherited from interface fdda.dialog.GraphicsControl |
DELETE, DIRECTED_LINE, LINE, NODE, POINTER, S_LOCKED, S_UNLOCKED |
Constructor Summary | |
Java2DControl()
Constructor. |
Method Summary | |
void |
attachToFrame(JInternalFrame frame,
MainFrame mainFrame)
Attaches the control instance to a frame. |
void |
deleteSelection()
Deletes selected components |
int |
getEditingMode()
Returns the current mode |
GraphicalSystem |
getGraphicalSystem()
Returns the graphical system |
MessageControl |
getMessageControl()
Returns the object that manages the graphical messages. |
int |
getSelectedAction()
Returns the currently selected action |
void |
paint(Graphics g)
Paints the graphics, using a specified Graphics object |
BufferedImage |
paintOnImage()
Paints the graphics on an image. |
void |
redraw(Rectangle clippingRect,
Painter painter)
Repaints a part of the screen (that should contain the graphics). |
void |
selectMovables()
Selects all movable components. |
void |
setEditingMode(int mode)
Changes the mode |
void |
setGraphicalSystem(GraphicalSystem system)
Sets the graphical system that is managed |
void |
setSelectedAction(int action)
Selects an action for the user |
double |
stringHeight()
Returns the height of a (any) string in the current graphics context. |
double |
stringWidth(String s)
Returns the width of a string in the current graphics context. |
void |
zoomIn()
Zooms in. |
void |
zoomOut()
Zooms out. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final Color GREY
public static final double ZOOM_OUT_SCALE
Constructor Detail |
public Java2DControl()
Method Detail |
public void attachToFrame(JInternalFrame frame, MainFrame mainFrame)
attachToFrame
in interface SwingGraphicsControl
frame
- the internal framemainFrame
- the main frame of the applicationpublic GraphicalSystem getGraphicalSystem()
GraphicHolder
getGraphicalSystem
in interface GraphicHolder
public void setGraphicalSystem(GraphicalSystem system)
GraphicsControl
setGraphicalSystem
in interface GraphicsControl
system
- the systempublic void redraw(Rectangle clippingRect, Painter painter)
GraphicHolder
redraw
in interface GraphicHolder
clippingRect
- a rectangle defining the clipping areapainter
- the painter instance used for drawingComponent.repaint()
public double stringWidth(String s)
GraphicHolder
stringWidth
in interface GraphicHolder
s
- the string
public double stringHeight()
GraphicHolder
stringHeight
in interface GraphicHolder
FontMetrics.getHeight()
public void zoomIn()
GraphicsControl
zoomIn
in interface GraphicsControl
public void zoomOut()
GraphicsControl
zoomOut
in interface GraphicsControl
public void selectMovables()
GraphicsControl
selectMovables
in interface GraphicsControl
public void deleteSelection()
GraphicsControl
deleteSelection
in interface GraphicsControl
public void paint(Graphics g)
GraphicsControl
paint
in interface GraphicsControl
g
- the graphics objectpublic BufferedImage paintOnImage()
GraphicsControl
paintOnImage
in interface GraphicsControl
public void setEditingMode(int mode)
GraphicsControl
setEditingMode
in interface GraphicsControl
mode
- the new mode (one of the constants)public int getEditingMode()
GraphicsControl
getEditingMode
in interface GraphicsControl
public void setSelectedAction(int action)
GraphicsControl
setSelectedAction
in interface GraphicsControl
action
- the new action (one of the constants)public int getSelectedAction()
GraphicsControl
getSelectedAction
in interface GraphicsControl
public MessageControl getMessageControl()
GraphicsControl
getMessageControl
in interface GraphicsControl
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |