|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jaxodraw.graph.JaxoGraph
public class JaxoGraph
A JaxoGraph is an extended version of a JaxoSaveGraph. In addition to the list of JaxoObjects, the latex packages and the description of the graph, it contains some information about how the graph is presented on the screen. Note that the information in JaxoGraph is not restored when saving and opening graphs. Only JaxoSaveGraph is serializable.
Constructor Summary | |
---|---|
JaxoGraph()
Creates a new JaxoGraph with empty list of objects, empty description and empty saveFileName. |
|
JaxoGraph(JaxoList<JaxoObject> list)
Creates a new JaxoGraph with the given list of objects, empty description and empty saveFileName. |
|
JaxoGraph(JaxoList<JaxoObject> list,
String describe)
Creates a new JaxoGraph with the given list of objects and description and empty saveFileName. |
|
JaxoGraph(JaxoList<JaxoObject> list,
String describe,
String saveFile)
Creates a new JaxoGraph with the given list of objects, description and saveFileName. |
Method Summary | |
---|---|
void |
addObject(int index,
JaxoObject object)
Inserts a JaxoObject into the list of objects at a specified position and flags the JaxoGraph as not saved (if it has been modified). |
void |
addObject(JaxoObject object)
Adds the specified JaxoObject to the list of objects by appending it and flags the JaxoGraph as not saved (if it has been modified). |
void |
background(JaxoObject object)
Puts the specified JaxoObject into the background, i.e., to the first position in the object list. |
void |
breakAllGroups()
Breaks all the groups in this graph. |
void |
clear()
Removes all JaxoObjects from the list of objects. |
void |
clearAll()
Removes all JaxoObjects from the list of objects and sets the saveFileName to a string of size zero. |
boolean |
containsGroups()
Checks if there are Group objects present in this graph. |
boolean |
containsInstanceOf(Class<?> clazz)
Checks if there are instances if the given Class present in this graph. |
boolean |
containsLatexText()
Checks if there are LatexText objects present in this current graph. |
boolean |
containsMarkedGroups()
Checks if there are marked Group objects present in the current selection. |
boolean |
containsMarkedObjects()
Checks if there are marked objects present in this graph. |
boolean |
containsPSText()
Checks if there are PSText objects present in this current graph. |
static JaxoList<JaxoObject> |
copyFrom(JaxoList<JaxoObject> v)
Returns a copy of the specified JaxoList. |
JaxoGraph |
copyOf()
Returns an exact copy of this JaxoGraph. |
void |
delete(JaxoObject object)
Removes the specified JaxoObject from the list of objects and flags the JaxoGraph as not saved (if it has been modified). |
void |
deleteAll(Collection<JaxoObject> objects)
Removes the specified JaxoObjects from the list of objects and flags the JaxoGraph as not saved (if it has been modified). |
void |
deleteMarkedObjects()
Removes all marked JaxoObjects from the list of objects and flags the JaxoGraph as not saved (if it has been modified). |
void |
foreground(JaxoObject object)
Puts the specified JaxoObject into the foreground, i.e., to the last position in the object list. |
Rectangle |
getBounds()
Returns the smallest bounding box that contains all the JaxoObjects of this JaxoGraph. |
Rectangle |
getBounds(Rectangle inside)
Intersection of bounding box with given Rectangle. |
Rectangle |
getBoundsExcept(Collection<JaxoObject> except)
Returns the smallest bounding box that contains all the JaxoObjects of this JaxoGraph except the ones given in 'except'. |
JaxoList<JaxoObject> |
getCopyOfMarkedObjects()
Copies of the marked objects of the graph, in the order of the graph. |
String |
getDescription()
Returns the description text of this JaxoGraph. |
JaxoList<JaxoObject> |
getMarkedObjects()
All marked objects of the graph, in the order of the graph. |
JaxoObject |
getNearestObject(int x,
int y)
Returns the JaxoObject in this graph that is closest to the given coordinates (ie which has the nearest handle). |
JaxoList<JaxoObject> |
getObjectList()
Returns the list of JaxoObjects. |
List<String> |
getPackageList()
Returns the list of Latex packages. |
String |
getSaveFileName()
Returns the current default save file name. |
JaxoSaveGraph |
getSaveGraph()
Returns the JaxoSaveGraph (i.e., the current list of objects and the current description) of the current JaxoGraph. |
boolean |
groupMarkedObjects()
Groups the currently marked objects. |
boolean |
hasMoreMarkedObjectsThan(int less)
Determines if at least a certain number of objects are marked ( containsMarkedObjects() == hasMoreMarkedObjectsThan(0) ). |
boolean |
isSaved()
Indicates whether the current JaxoGraph contains unsaved changes. |
JaxoObject |
listElementAt(int i)
Returns the JaxoObject at position i of the object list. |
int |
listSize()
Returns the size of the current object list, i.e., the number of objects it contains. |
void |
move(int index,
int newIndex)
Move the object at 'index' to 'newIndex', leaving all other elements in order. |
void |
objectsToBackground()
Puts all the objects in the current selection in the background. |
void |
objectsToForeground()
Puts all the objects in the current selection in the foreground. |
void |
paint(JaxoGraphics2D g)
Paint all objects to 'g'. |
void |
paintClipped(JaxoGraphics2D g)
Paint all objects to 'g' if they intersect the clip bounds. |
void |
paintHandles(JaxoGraphics2D g2,
JaxoHandle h,
int editMode)
Paints handles on all objects in this graph. |
void |
replace(JaxoObject old,
JaxoObject o)
Replace 'old' by 'o'. |
void |
setAsMarked(boolean marked)
Marks all objects in this graph. |
void |
setDescription(String describe)
Sets the description text of this JaxoGraph and flags the JaxoGraph as not saved. |
void |
setObjectList(JaxoList<JaxoObject> list)
Sets the list of objects of this JaxoGraph to list and flags the JaxoGraph as not saved. |
void |
setPackageList(List<String> list)
Sets the list of Latex packages of this JaxoGraph to list and flags the JaxoGraph as not saved. |
void |
setSaved(boolean isSaved)
Declares the current JaxoGraph as saved or unsaved, according to the boolean variable isSaved. |
void |
setSaveFileName(String fileName)
Sets the default file name for save operations. |
void |
setSaveGraph(JaxoSaveGraph newSaveGraph)
Sets the JaxoSaveGraph (i.e., the current list of objects and the current description) of the current JaxoGraph. |
boolean |
ungroup(JaxoObject ob)
If the given object is a group and contained in this graph, ungroup it. |
boolean |
ungroupMarkedObjects()
Ungroup (one level) all marked objects. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JaxoGraph()
public JaxoGraph(JaxoList<JaxoObject> list)
list
- The new list of objects. Not null.public JaxoGraph(JaxoList<JaxoObject> list, String describe)
list
- The new list of objects. Not null.describe
- String which decsribes this JaxoGraph. May be null.public JaxoGraph(JaxoList<JaxoObject> list, String describe, String saveFile)
list
- The new list of objects. Not null.describe
- String which describes this JaxoGraph. May be null.saveFile
- String holding the file name for saving. Not null.Method Detail |
---|
public final JaxoSaveGraph getSaveGraph()
public final void setSaveGraph(JaxoSaveGraph newSaveGraph)
newSaveGraph
- The new JaxoSaveGraph. Not null.public final JaxoList<JaxoObject> getObjectList()
public final void setObjectList(JaxoList<JaxoObject> list)
list
- The list of JaxoObjects. Not null.public final List<String> getPackageList()
public final void setPackageList(List<String> list)
list
- The list of Latex packages. Not null.public final void setDescription(String describe)
describe
- The description of this JaxoGraph. May be null.public final String getDescription()
public final boolean isSaved()
public final void setSaved(boolean isSaved)
isSaved
- Boolean variable to indicate whether the current
JaxoGraph is saved or not.public final void setSaveFileName(String fileName)
fileName
- The file name to be used for saving. Not null.public final String getSaveFileName()
public final JaxoObject listElementAt(int i)
i
- The index of the JaxoObject to be returned.
public final int listSize()
public final void foreground(JaxoObject object)
object
- The JaxoObject to be put into the foreground.public final void move(int index, int newIndex)
index
- The index of the object to move.newIndex
- The new index of the object.public final void replace(JaxoObject old, JaxoObject o)
old
- The object to replace. If this is not contained in this
graph, the graph is not modified.o
- The new object. Must not be null.public final void background(JaxoObject object)
object
- The JaxoObject to be put into the background.public final void delete(JaxoObject object)
object
- The JaxoObject to be removed from the list.public final void deleteMarkedObjects()
public final void deleteAll(Collection<JaxoObject> objects)
objects
- Collection of JaxoObjects to be removed from the list.public final void addObject(JaxoObject object)
object
- The JaxoObject to be added to the list.public final void addObject(int index, JaxoObject object)
index
- The position where the object has to be appendedobject
- The JaxoObject to be added to the list.public final void clear()
public final void clearAll()
public final Rectangle getBounds()
public final Rectangle getBoundsExcept(Collection<JaxoObject> except)
except
- objects to exclude.
public final Rectangle getBounds(Rectangle inside)
inside
- The Rectangle to intersect with.
getBounds()
public static final JaxoList<JaxoObject> copyFrom(JaxoList<JaxoObject> v)
v
- A JaxoList to be duplicated.
public final boolean containsPSText()
public final boolean containsLatexText()
public final boolean containsInstanceOf(Class<?> clazz)
clazz
- a Class to look for.
public final boolean containsMarkedGroups()
public final boolean containsGroups()
public final boolean containsMarkedObjects()
public JaxoList<JaxoObject> getMarkedObjects()
public JaxoList<JaxoObject> getCopyOfMarkedObjects()
public boolean hasMoreMarkedObjectsThan(int less)
containsMarkedObjects() == hasMoreMarkedObjectsThan(0)
).
less
- The lower bound to test.
public void paint(JaxoGraphics2D g)
g
- The graphics context to paint to.public void paintClipped(JaxoGraphics2D g)
g
- The graphics contect to paint to.public final void paintHandles(JaxoGraphics2D g2, JaxoHandle h, int editMode)
g2
- The graphics context to paint the handles to.h
- The handle to paint.editMode
- The edit mode that the handles are being painted in.public final void setAsMarked(boolean marked)
marked
- A boolean that indicates whether to mark or not.public final JaxoGraph copyOf()
public final void breakAllGroups()
public final void objectsToForeground()
public final void objectsToBackground()
public final JaxoObject getNearestObject(int x, int y)
x
- The x coordinate.y
- The y coordinate.
public boolean ungroupMarkedObjects()
public boolean groupMarkedObjects()
public boolean ungroup(JaxoObject ob)
ob
- the object to ungroup.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |