public class JaxoTab
extends java.lang.Object
Constructor and Description |
---|
JaxoTab()
Constructor.
|
JaxoTab(JaxoDefaultGrid g)
Constructor.
|
JaxoTab(JaxoGraph g)
Constructor.
|
JaxoTab(JaxoGraph g,
JaxoDefaultGrid grid)
Constructor.
|
Modifier and Type | Method and 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.
|
JaxoDefaultGrid |
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 |
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 |
setCanvas(JaxoCanvas value)
Redraws the given canvas with this tab's graph.
|
void |
setGridColor(java.awt.Color color)
Sets the color of 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 |
setTabGraph(JaxoGraph theGraph)
Sets this tab's graph.
|
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()
public JaxoTab(JaxoGraph g)
g
- The graph for the tab.public JaxoTab(JaxoDefaultGrid g)
g
- A grid for the tab.public JaxoTab(JaxoGraph g, JaxoDefaultGrid grid)
g
- A graph.grid
- A grid.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 void setTabGraph(JaxoGraph theGraph)
theGraph
- The new graph.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 void setCanvas(JaxoCanvas value)
value
- The canvas to update.public JaxoDefaultGrid getGrid()
public final void setSnappingToGrid(boolean value)
value
- Boolean that sets the grid on/off.public final boolean isSnappingToGrid()
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.public final int getGridType()
public final void setGridStyle(int style)
style
- The style of the grid to be set.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.