|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
jpicedt.ui.PEDrawingBoard
public class PEDrawingBoard
A drawing board based on jpicedt.graphic.PECanvas, with an embeded scrollpane, and
some I/O facilities (saving and loading) which PECanvas doesn't have.
There are two accessors two retrieve the embedded canvas and scrollpane.
Nested Class Summary | |
---|---|
class |
PEDrawingBoard.GridZoomToolBar
A toolbar that allows the user to change the grid and zoom properties |
class |
PEDrawingBoard.StatusBar
jpicedt's Status Bar |
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
PEDrawingBoard(int untitledIndex,
double zoom,
PageFormat pageFormat,
Grid grid,
ContentType contentType)
create a new empty drawing board with a (localized) "untitled" title |
|
PEDrawingBoard(int untitledIndex,
Properties preferences)
create a new empty drawing board with a (localized) "untitled" title Init zoom, pageFormat, contentType and undoableLimit from the given Properties, using : - key = PECanvas.KEY_ZOOM, value = a double - key = PageFormat.KEY_PAGE_FORMAT (see jpicedt.graphic.PageFormat for details) - key = PECanvas.KEY_CONTENT_TYPE, value = path of ContentType class (e.g. |
|
PEDrawingBoard(String path,
double zoom,
PageFormat pageFormat,
Grid grid,
ContentType contentType,
Parser parser)
create a new drawing board pre-loaded from the given path ; set title from this path. |
|
PEDrawingBoard(String path,
Properties preferences,
Parser parser)
create a new drawing board pre-loaded from the given path ; set title from this path. |
Method Summary | |
---|---|
PECanvas |
getCanvas()
|
PopupMenuFactory |
getPopupMenuFactory()
|
PEScrollPane |
getScrollPane()
|
PEDrawingBoard.StatusBar |
getStatusBar()
Return the status bar |
String |
getTitle()
|
void |
insert(String path,
Parser parser)
Insert new content from the given path into this board's drawing |
boolean |
isDirty()
|
boolean |
isSaved()
|
void |
load(String path,
Parser parser)
Load this board's content from the given path |
void |
reload(Parser parser)
Reload the content of this board from its current file name if applicable ; do nothing otherwise. |
boolean |
save(boolean alwaysPrompt)
Save drawing content to disk. |
void |
save(String fileName,
boolean selectionOnly)
Save drawing or selection content the given file. |
boolean |
saveFragment()
save the selection content to the "fragment directory" on disk, prompting user for a file name |
void |
setDirty(boolean dirty)
mark this board as being dirty |
void |
setPopupMenuFactory(PopupMenuFactory factory)
Set the PopupMenuFactory that produces JPopupMenu when a popup-trigger mouse event occurs on the board. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public PEDrawingBoard(int untitledIndex, double zoom, PageFormat pageFormat, Grid grid, ContentType contentType)
untitledIndex
- index appended to "untitled", e.g. "Untitled 2"public PEDrawingBoard(String path, double zoom, PageFormat pageFormat, Grid grid, ContentType contentType, Parser parser)
public PEDrawingBoard(int untitledIndex, Properties preferences)
untitledIndex
- index appended to "untitled", e.g. "Untitled 2"public PEDrawingBoard(String path, Properties preferences, Parser parser)
Method Detail |
---|
public void setPopupMenuFactory(PopupMenuFactory factory)
public PopupMenuFactory getPopupMenuFactory()
public PECanvas getCanvas()
public PEScrollPane getScrollPane()
public boolean isSaved()
public boolean isDirty()
This signal that this board need to be saved during "save", "save all",... actions.
public void setDirty(boolean dirty)
public String getTitle()
public boolean save(boolean alwaysPrompt)
if alwaysPrompt is false, save to disk using the current title ; prompt user if it's null,
ie this board has never been saved.
if alwaysPrompt is true, prompt user for a file name (aka "save as...") in any case.
public boolean saveFragment()
public void save(String fileName, boolean selectionOnly) throws IOException
fileName
- name of file to save content toselectionOnly
- whether to save the content of the selection or that of the whole the drawing
IOException
public void load(String path, Parser parser)
public void insert(String path, Parser parser)
public void reload(Parser parser)
public PEDrawingBoard.StatusBar getStatusBar()
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |