All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class CH.ifa.draw.standard.MyCompartmentPanel

java.lang.Object
   |
   +----CH.ifa.draw.standard.AbstractFigure
           |
           +----CH.ifa.draw.standard.CompositeFigure
                   |
                   +----CH.ifa.draw.standard.PanelComposite
                           |
                           +----CH.ifa.draw.standard.CompartmentPanel
                                   |
                                   +----CH.ifa.draw.standard.MyCompartmentPanel

public class MyCompartmentPanel
extends CompartmentPanel
A test implementation.


Variable Index

 o fCompMenu
The popup menu for choosing which kind of compartment to create.

Constructor Index

 o MyCompartmentPanel()
 o MyCompartmentPanel(Point, Point)

Method Index

 o createCenteredListAt(int, int)
Create a new compartment at the point (x,y).
 o createCompartmentAt(int, int, DrawingView)
Create a new compartment at the point (x,y).
 o createCompartments(Point, Point)
Creates one FigureHolder compartment by default.
 o createFigureHolderAt(int, int)
Create a FigureHolder that is inserted after the compartment found currently at (x,y).
 o createRootFigure()
Creates a RootRoundRectangleFigure.
 o createRootFigure(Point, Point)
Creates a RootRoundRectangleFigure.
 o drawDividers(Graphics)
Draws a horizontal solid line after each name compartment and a vertical dashed line after each state machine compartment (except the last).
 o getCompartmentPopup(DrawingView)
Gets the popup menu for choosing which kind of compartment to create.
 o getLayout(Point, Point)
Computes and returns the layout of figure holders within the box defined by origin and corner.
 o getMinimumLayout()
Returns a vector of rectangles representing the minimum space required by the compartments arranged according to the current layout strategy.
 o removeCompartmentAt(int, int)
Delete the compartment at the point (x,y).
 o setCompartmentMenuItems(PopupMenu, int, int)
Fills the new compartment choosing menu with action listeners to invoke the appropriate compartment creation methods of this.

Variables

 o fCompMenu
 protected static PopupMenu fCompMenu
The popup menu for choosing which kind of compartment to create.

Constructors

 o MyCompartmentPanel
 public MyCompartmentPanel()
 o MyCompartmentPanel
 public MyCompartmentPanel(Point origin,
                           Point corner)

Methods

 o getCompartmentPopup
 protected static PopupMenu getCompartmentPopup(DrawingView view)
Gets the popup menu for choosing which kind of compartment to create. Creates the menu when called for the first time.

 o createRootFigure
 protected RootFigure createRootFigure()
Creates a RootRoundRectangleFigure.

Overrides:
createRootFigure in class PanelComposite
 o createRootFigure
 protected RootFigure createRootFigure(Point origin,
                                       Point corner)
Creates a RootRoundRectangleFigure.

Overrides:
createRootFigure in class PanelComposite
 o createCompartments
 protected void createCompartments(Point origin,
                                   Point corner)
Creates one FigureHolder compartment by default.

Overrides:
createCompartments in class CompartmentPanel
 o getMinimumLayout
 protected Vector getMinimumLayout()
Returns a vector of rectangles representing the minimum space required by the compartments arranged according to the current layout strategy. The name compartments are tiled vertically (top-down) and the and - state machine compartments are tiled horizontally (from left to right).

Overrides:
getMinimumLayout in class CompartmentPanel
 o getLayout
 protected Vector getLayout(Point origin,
                            Point corner)
Computes and returns the layout of figure holders within the box defined by origin and corner. The layout is returned as a vector of rectangles that holds the new display boxes of the holders. The name compartments are tiled vertically (top-down) and the and - state machine compartments are tiled horizontally (from left to right).

The name compartments are stretched horizontally to fill the display box. The state machine compartments are stretched vertically to fill the display box - the last compartment is also stretched horizontally.

Overrides:
getLayout in class CompartmentPanel
 o drawDividers
 public void drawDividers(Graphics g)
Draws a horizontal solid line after each name compartment and a vertical dashed line after each state machine compartment (except the last).

Overrides:
drawDividers in class CompartmentPanel
 o createFigureHolderAt
 public void createFigureHolderAt(int x,
                                  int y)
Create a FigureHolder that is inserted after the compartment found currently at (x,y).

 o createCenteredListAt
 public void createCenteredListAt(int x,
                                  int y)
Create a new compartment at the point (x,y). The created compartment is a Centering Holder that is inserted after the compartment found currently at (x,y). If the compartment under (x,y) is not a Centering Holder (name compartment), adds the new compartment as the last name compartment.

 o setCompartmentMenuItems
 protected void setCompartmentMenuItems(PopupMenu chooseCompartment,
                                        int x,
                                        int y)
Fills the new compartment choosing menu with action listeners to invoke the appropriate compartment creation methods of this.

 o createCompartmentAt
 public void createCompartmentAt(int x,
                                 int y,
                                 DrawingView view)
Create a new compartment at the point (x,y). The created compartment is a default FigureHolder that is inserted after the compartment found currently at (x,y).

Overrides:
createCompartmentAt in class CompartmentPanel
 o removeCompartmentAt
 public void removeCompartmentAt(int x,
                                 int y)
Delete the compartment at the point (x,y). The contents of the compartment is merged with the previous compartment.

Overrides:
removeCompartmentAt in class CompartmentPanel

All Packages  Class Hierarchy  This Package  Previous  Next  Index