public class JaxoTab
extends java.lang.Object
Constructor | Description |
---|---|
JaxoTab(JaxoDrawingArea canvas) |
Constructor.
|
JaxoTab(JaxoDrawingArea canvas,
JaxoGraph g) |
Constructor.
|
JaxoTab(JaxoDrawingArea canvas,
JaxoGraph g,
JaxoPaintableGrid grid) |
Constructor.
|
JaxoTab(JaxoDrawingArea canvas,
JaxoPaintableGrid g) |
Constructor.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addChangeListener(javax.swing.event.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(java.awt.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.
|
java.awt.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.
|
javax.swing.JComponent |
getRoot() |
Returns the root component of this tab.
|
java.lang.String |
getSaveFileName() |
Returns the current save file name.
|
JaxoGraph |
getTabGraph() |
Returns this tab's graph.
|
int |
getTabMode() |
Returns the tab mode.
|
java.lang.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(javax.swing.event.ChangeListener l) |
Removes a change listener.
|
void |
revalidate() |
Initialize the canvas with this tab's graph and grid.
|
void |
setGridColor(java.awt.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(java.lang.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(java.lang.String theTitle) |
Sets this tab's title.
|
void |
undoMove() |
Undo last operation.
|
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.public static JaxoTab asJaxoTab(java.awt.Component c)
c
- The component to test.public final javax.swing.JComponent getRoot()
public final JaxoGraph getTabGraph()
public final java.lang.String getTabTitle()
public final void setTabTitle(java.lang.String theTitle)
theTitle
- The new title.public void addChangeListener(javax.swing.event.ChangeListener l)
l
- The listener to add.public void removeChangeListener(javax.swing.event.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(java.awt.Color color)
color
- The color of the grid to be set.public final java.awt.Color getGridColor()
public void commitGraphChanges()
public void commitRepeatableGraphChanges()
public void commitRepeatableGraphChanges(int count)
count
- The number of changes to commit.public void setSaveFileName(java.lang.String value)
value
- The name to set.public final java.lang.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()
Licensed under GPL. For more information, see http://jaxodraw.sourceforge.net/license.html or the LICENSE file in the jaxodraw distribution.