|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.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.BaselineResizeBehavior, 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 author: Sylvain Reynal |
|
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 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,
ExtractionParsing parser)
Create a new drawing board pre-loaded from the given path ; set title from this path. |
|
PEDrawingBoard(String path,
Properties preferences,
ExtractionParsing parser)
Create a new drawing board pre-loaded from the given path ; set title from this path. |
Method Summary | |
---|---|
PECanvas |
getCanvas()
author: Sylvain Reynal |
PopupMenuFactory |
getPopupMenuFactory()
|
PEScrollPane |
getScrollPane()
author: Sylvain Reynal |
PEDrawingBoard.StatusBar |
getStatusBar()
Return the status bar |
String |
getTitle()
author: Sylvain Reynal |
void |
insert(String path,
ExtractionParsing parser,
PicPoint insertionPoint)
Insert new content from the given path into this board's drawing author: Sylvain Reynal |
boolean |
isDirty()
author: Sylvain Reynal |
boolean |
isSaved()
author: Sylvain Reynal |
void |
load(String path,
ExtractionParsing parser)
Load this board's content from the given path author: Sylvain Reynal |
void |
reload(ExtractionParsing 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, ExtractionParsing parser)
public 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:
PECanvas.KEY_ZOOM
, value = a doublePageFormat.KEY_PAGE_FORMAT
(see PageFormat
for details)PECanvas.KEY_CONTENT_TYPE
, value = path of
ContentType
class
(e.g. "jpicedt.format.latex.ContentType")PECanvas.KEY_UNDOABLE_STEPS
, value = nb of
undoable events to remember suitable for instanciation by
Class.forName("xxx").newInstance(). "preferences" is also used to
init the ContentType
, if non-null
.
untitledIndex
- index appended to "untitled", e.g. "Untitled 2"public PEDrawingBoard(String path, Properties preferences, ExtractionParsing parser)
Method Detail |
---|
public void setPopupMenuFactory(PopupMenuFactory factory)
PopupMenuFactory
that produces JPopupMenu
when a popup-trigger mouse
event occurs on the board.
public PopupMenuFactory getPopupMenuFactory()
PopupMenuFactory
that produces JPopupMenu
when a popup-trigger
mouse event occurs on the board.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.
false
if operation was cancelled by user or an I/O error occuredpublic 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, ExtractionParsing parser)
public void insert(String path, ExtractionParsing parser, PicPoint insertionPoint)
public void reload(ExtractionParsing parser)
public PEDrawingBoard.StatusBar getStatusBar()
|
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |