|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jaxodraw.gui.JaxoTab
public class JaxoTab
One tab of the JaxoTabbedPane.
Constructor Summary | |
---|---|
JaxoTab(JaxoDrawingArea canvas)
Constructor. |
|
JaxoTab(JaxoDrawingArea canvas,
JaxoGraph g)
Constructor. |
|
JaxoTab(JaxoDrawingArea canvas,
JaxoGraph g,
JaxoPaintableGrid grid)
Constructor. |
|
JaxoTab(JaxoDrawingArea canvas,
JaxoPaintableGrid g)
Constructor. |
Method Summary | |
---|---|
void |
addChangeListener(ChangeListener l)
ChangeEvents will be fired when a graph change is performed, basically this means when the properties "canUndo", "canRedo", "isSaved" and "saveFileName" may have changed. |
static JaxoTab |
asJaxoTab(Component c)
Determine if a component is a JaxoTab. |
boolean |
canRedo()
Determines if redo is possible. |
boolean |
canUndo()
Determines if undo is possible. |
void |
clearBackupList()
Clear undo history. |
void |
commitGraphChanges()
Commit changes to 'tabGraph' to the undo history. |
void |
commitRepeatableGraphChanges()
Commit changes to 'tabGraph' to the undo history, where the change is the addition of the last object that should be repeatable. |
void |
commitRepeatableGraphChanges(int count)
Commit changes to 'tabGraph' to the undo history, where the change is the addition of 'count' last objects that should be repeatable. |
protected void |
fireStateChanged()
Notifies all listeners of state changes. |
JaxoPaintableGrid |
getGrid()
Returns the current grid. |
Color |
getGridColor()
Returns the current color of the grid. |
int |
getGridSize()
Returns the current size of the grid. |
int |
getGridStyle()
Returns the current style of the grid. |
int |
getGridType()
Returns the current type of the grid. |
JComponent |
getRoot()
Returns the root component of this tab. |
String |
getSaveFileName()
Returns the current save file name. |
JaxoGraph |
getTabGraph()
Returns this tab's graph. |
int |
getTabMode()
Returns the tab mode. |
String |
getTabTitle()
Returns this tab's title. |
boolean |
hasBeenUsed()
Indicates whether this tab has been used. |
boolean |
isGridPainted()
Check if the grid is switched on. |
boolean |
isSaved()
Determines if the graph is saved. |
boolean |
isSnappingToGrid()
Determines whether snapping to the grid is currently on. |
void |
newGraph()
Starts a new graph for this tab. |
void |
redoMove()
Redo last operation. |
void |
removeChangeListener(ChangeListener l)
Removes a change listener. |
void |
revalidate()
Initialize the canvas with this tab's graph and grid. |
void |
setGridColor(Color color)
Sets the color of the grid. |
void |
setGridPainted(boolean on)
Switch on the grid. |
void |
setGridSize(int gs)
Sets the size of the grid to the given value. |
void |
setGridStyle(int style)
Sets the style of the grid. |
void |
setGridType(int type)
Sets the type of the grid. |
void |
setSaved(boolean value)
Sets the tab saved / not saved. |
void |
setSaveFileName(String value)
Sets the save file name. |
void |
setSnappingToGrid(boolean value)
Switches snapping to the grid on/off. |
void |
setTabMode(int mode)
Sets the tab mode. |
void |
setTabTitle(String theTitle)
Sets this tab's title. |
void |
undoMove()
Undo last operation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JaxoTab(JaxoDrawingArea canvas)
canvas
- the drawing area on which to paint this tab.public JaxoTab(JaxoDrawingArea canvas, JaxoGraph g)
canvas
- the drawing area on which to paint this tab.g
- The graph for the tab.public JaxoTab(JaxoDrawingArea canvas, JaxoPaintableGrid g)
canvas
- the drawing area on which to paint this tab.g
- A grid for the tab.public JaxoTab(JaxoDrawingArea canvas, JaxoGraph g, JaxoPaintableGrid grid)
canvas
- the drawing area on which to paint this tab.g
- A graph.grid
- A grid. May be null.Method Detail |
---|
public static JaxoTab asJaxoTab(Component c)
c
- The component to test.
public final JComponent getRoot()
public final JaxoGraph getTabGraph()
public final String getTabTitle()
public final void setTabTitle(String theTitle)
theTitle
- The new title.public void addChangeListener(ChangeListener l)
l
- The listener to add.public void removeChangeListener(ChangeListener l)
l
- The listener to remove.protected void fireStateChanged()
public final void revalidate()
public JaxoPaintableGrid getGrid()
public final void setSnappingToGrid(boolean value)
value
- Boolean that sets the grid on/off.public final boolean isSnappingToGrid()
public void setGridPainted(boolean on)
on
- true if the grid should be painted, false otherwise.public boolean isGridPainted()
public final void setGridSize(int gs)
gs
- The grid size to be set.public final int getGridSize()
public final void setGridType(int type)
type
- The type of the grid to be set.
One of the types defined in JaxoConstants
.public final int getGridType()
public final void setGridStyle(int style)
style
- The style of the grid to be set.
One of the styles defined in JaxoConstants
.public final int getGridStyle()
public final void setGridColor(Color color)
color
- The color of the grid to be set.public final Color getGridColor()
public void commitGraphChanges()
public void commitRepeatableGraphChanges()
public void commitRepeatableGraphChanges(int count)
count
- The number of changes to commit.public void setSaveFileName(String value)
value
- The name to set.public final String getSaveFileName()
public void clearBackupList()
public void newGraph()
public void undoMove()
public void redoMove()
public void setTabMode(int mode)
mode
- The tab mode.public int getTabMode()
public boolean hasBeenUsed()
public void setSaved(boolean value)
value
- True for saved.public boolean isSaved()
public boolean canUndo()
public boolean canRedo()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |