de.caff.dxf.applet
Class DxfApplet

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by java.applet.Applet
                  extended by javax.swing.JApplet
                      extended by de.caff.dxf.applet.DxfApplet
All Implemented Interfaces:
ImageSaveHelper, VectorSaveHelper, ViewerConstantsSwing, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer

public class DxfApplet
extends javax.swing.JApplet
implements ImageSaveHelper, VectorSaveHelper, ViewerConstantsSwing

Running a DXF viewer as an applet. The Applet is able to run in two different modes:

  1. in page
  2. framed, i. e. in a window of its own (similar to the DXF Viewer window)
In the latter case the applet's GUI is configured by a XML description.

Version:
$Revision: 989 $
Author:
Rammi
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JApplet
javax.swing.JApplet.AccessibleJApplet
 
Nested classes/interfaces inherited from class java.applet.Applet
java.applet.Applet.AccessibleApplet
 
Nested classes/interfaces inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static java.lang.String BT_DISPLAY_FRAME
          I18n key for button to show frame.
static java.lang.String DEFAULT_GUI_DESCR
          The default GUI description used if none is given.
static java.lang.String ERR_APP_CONFIG_IO
          I18n key for i/o error while reading configuration.
static java.lang.String ERR_APP_CONFIG_PARSER
          I18n key for SAX parser configuration error.
static java.lang.String ERR_APP_PARSE_READ
          I18n key for SAX parser error.
static java.lang.String ERR_NO_SAVE_FORMAT
          I18n key for error when saving in unsupported format.
static java.lang.String ERR_RESTRICT_NO_SAVE
          I18n kex for error message when trying to save in an restricted environment.
static double FLAT_EPSILON
          Epsilon to determine if a file is considered flat.
static java.lang.String FULLNAME
          The default name of the applet.
static java.lang.String MAILTO
          The default mailto address.
static java.lang.String MI_CLOSE_WINDOW
          I18n key for menu action close window.
static java.lang.String PARAM_ADDITIONAL_FONTDIR
          Additional font dir.
static java.lang.String PARAM_APPLET_INPAGE
          Applet parameter for boolean value whether applet should run inpage.
static java.lang.String PARAM_APPLET_STATE_CALLBACK
          Applet state callback.
static java.lang.String PARAM_COOKIES
          Cookies to set for any requests to the server.
static java.lang.String PARAM_DEFAULT_BIGFONT
          Default bigfont.
static java.lang.String PARAM_DEFAULT_CODEPAGE
          Default codepage.
static java.lang.String PARAM_DEFAULT_FONT
          Default font.
static java.lang.String PARAM_DXF_FILE
          Applet parameter for dxf file(s) to display.
static java.lang.String PARAM_FRAME_HEIGHT
          Applet parameter for frame height (only when framed).
static java.lang.String PARAM_FRAME_WIDTH
          Applet parameter for frame width (only when framed).
static java.lang.String PARAM_GUI_DESCR
          Applet parameter for GUI description file.
static java.lang.String PARAM_LOAD_BACKGROUND
          Load DXF file in background?
static java.lang.String PARAM_MODEL_UNIT_LENGTH
          Unit length of the model (necessary for scaled printing).
static java.lang.String PARAM_PRINT_FONT
          Applet parameter for the font used for showing the file name when printing the view.
static java.lang.String PARAM_PRINT_MODE
          Applet parameter defining the printing mode.
static java.lang.String PARAM_PRINT_TO_SCALE
          Deprecated. Use PARAM_PRINT_MODE instead
static java.lang.String PARAM_PRINT_VIEW
          Applet parameter for printing the view instead of the complete applet.
static java.lang.String PARAM_PRINTER_POINT_SIZE
          Parameter for printer point size.
static java.lang.String REVISION
          The SVN revision of this file.
static java.lang.String VERSION
          The version number of the applet.
 
Fields inherited from class javax.swing.JApplet
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface de.caff.dxf.swing.ViewerConstantsSwing
APP_NAME, DEFAULT_BACKGROUND_COLOR, DEFAULT_MANIPULATOR_COLOR, PROGRESS_CONV_COLOR, PROGRESS_READ_COLOR, PROGRESS_WRITE_COLOR, WEBSITE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
DxfApplet()
          Constructor.
 
Method Summary
 boolean canGoBackward()
          Is it possible to go a step backward in history?
 boolean canGoForward()
          Is it possible to go a step forward in history?
 void closeFrame()
          Hides the frame if it is shown.
 void copyViewToClipboard()
          Copy the current view as a bitmap image to the system clipboard.
 void destroy()
          Called by the browser or applet viewer to inform this applet that it is being reclaimed and that it should destroy any resources that it has allocated.
 void doSave(java.lang.String path, java.lang.String format)
          Save the image in the given format to the given location.
 java.lang.String getAppletInfo()
          Returns information about this applet.
 SimpleAppletState getAppletState()
          Get the current applet state.
 int getCurrentMatchIndex()
          Get the number of matches for the current search text.
 java.awt.Frame getDialogParentFrame()
          Get a frame to be used as a dialog parent for the write dialog.
protected  java.net.URL getGuiDescriptionURL(java.lang.String defaultDescr)
          Get the URL describing the GUI.
 java.io.File getLastSaveDir()
          Get the last dir where something was saved.
 java.lang.String[] getLayerNames()
          Get the names of the layers in the current model.
 PhysicalLength getModelUnit()
          Get the currently used model unit.
 int getNumberOfSearchMatches()
          Get the number of matches for the current search text.
 java.lang.String[][] getParameterInfo()
          Returns information about the parameters that are understood by this applet.
 java.util.prefs.Preferences getPreferences()
          Get the preferences access object.
 PrintMode getPrintMode()
          Get the current print mode.
 java.awt.Color getProgressReadColor()
          Get the color for the progress bar during file read.
 ProgressShower getProgressShower()
          Get the progress shower used for progress display.
 java.awt.Color getProgressWriteColor()
          Get the color for the progress bar during file write.
 java.lang.String getSearchText()
          Get the current search text.
 TemporaryPainter getTemporaryPainter()
          Get a temporary painter which draws the current model.
 double getViewAspectRatio()
          Get the aspect ration of the view.
 void goBackward()
          Go a step backward in history if possible.
 void goForward()
          Go a step forward in history if possible.
 void init()
          Called by the browser or applet viewer to inform this applet that it has been loaded into the system.
 boolean isLayerVisible(java.lang.String layerName)
          Is a given layer visible?
 void loadDxfFile(java.lang.String location)
          Load a DXF file into the applet.
 void loadDxfFile(java.lang.String location, boolean addToCurrent)
          Load a DXF file into the applet.
 void print(java.awt.Graphics g)
          Prints the container.
 void printAll(java.awt.Graphics g)
           
 void printComponents(java.awt.Graphics g)
           
 void printView()
          Print the current view.
 void resetView()
          Reset the view to initial state.
 void saveView(java.lang.String format)
          Save the current view in a given format.
 int searchNext()
          Perform a search.
 void setLayerVisible(java.lang.String layerName, boolean visible)
          Set the visibility of a given layer.
 void setModelUnit(PhysicalLength modelUnit)
          Set the currently used model unit.
 void setPrintMode(PrintMode printMode)
          Set the current print mode.
 void setProgressReadColor(java.awt.Color progressReadColor)
          Set the color for the progress bar during file read.
 void setProgressWriteColor(java.awt.Color progressWriteColor)
          Set the color for the progress bar during file write.
 int setSearchSettings(boolean backward, boolean caseSensitive, boolean matchWords)
          Set various settings for searching.
 int setSearchText(java.lang.String text)
          Set the search text.
 void showError(java.lang.String msg)
          Show an error dialog.
 void showError(java.lang.Throwable x)
          Show an error for an exception.
 void showFrame()
          Shows the frame if it was hidden.
 
Methods inherited from class javax.swing.JApplet
addImpl, createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
 
Methods inherited from class java.applet.Applet
getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

VERSION

public static final java.lang.String VERSION
The version number of the applet.

See Also:
Constant Field Values

REVISION

public static final java.lang.String REVISION
The SVN revision of this file.

See Also:
Constant Field Values

FULLNAME

public static final java.lang.String FULLNAME
The default name of the applet.

See Also:
Constant Field Values

MAILTO

public static final java.lang.String MAILTO
The default mailto address.

See Also:
Constant Field Values

PARAM_APPLET_INPAGE

public static final java.lang.String PARAM_APPLET_INPAGE
Applet parameter for boolean value whether applet should run inpage.

See Also:
Constant Field Values

PARAM_DXF_FILE

public static final java.lang.String PARAM_DXF_FILE
Applet parameter for dxf file(s) to display.

See Also:
Constant Field Values

PARAM_FRAME_WIDTH

public static final java.lang.String PARAM_FRAME_WIDTH
Applet parameter for frame width (only when framed).

See Also:
Constant Field Values

PARAM_FRAME_HEIGHT

public static final java.lang.String PARAM_FRAME_HEIGHT
Applet parameter for frame height (only when framed).

See Also:
Constant Field Values

PARAM_GUI_DESCR

public static final java.lang.String PARAM_GUI_DESCR
Applet parameter for GUI description file.

See Also:
Constant Field Values

PARAM_PRINT_VIEW

public static final java.lang.String PARAM_PRINT_VIEW
Applet parameter for printing the view instead of the complete applet.

See Also:
Constant Field Values

PARAM_PRINT_FONT

public static final java.lang.String PARAM_PRINT_FONT
Applet parameter for the font used for showing the file name when printing the view.

See Also:
Constant Field Values

PARAM_PRINT_TO_SCALE

@Deprecated
public static final java.lang.String PARAM_PRINT_TO_SCALE
Deprecated. Use PARAM_PRINT_MODE instead
Applet parameter for printing scaled (only if PARAM_PRINT_VIEW is set to true).

See Also:
Constant Field Values

PARAM_PRINT_MODE

public static final java.lang.String PARAM_PRINT_MODE
Applet parameter defining the printing mode.

See Also:
Constant Field Values

PARAM_MODEL_UNIT_LENGTH

public static final java.lang.String PARAM_MODEL_UNIT_LENGTH
Unit length of the model (necessary for scaled printing).

See Also:
Constant Field Values

PARAM_PRINTER_POINT_SIZE

public static final java.lang.String PARAM_PRINTER_POINT_SIZE
Parameter for printer point size. Should be 1/72", but some printers differ.

See Also:
Constant Field Values

PARAM_DEFAULT_CODEPAGE

public static final java.lang.String PARAM_DEFAULT_CODEPAGE
Default codepage.

See Also:
Constant Field Values

PARAM_DEFAULT_FONT

public static final java.lang.String PARAM_DEFAULT_FONT
Default font.

See Also:
Constant Field Values

PARAM_DEFAULT_BIGFONT

public static final java.lang.String PARAM_DEFAULT_BIGFONT
Default bigfont.

See Also:
Constant Field Values

PARAM_ADDITIONAL_FONTDIR

public static final java.lang.String PARAM_ADDITIONAL_FONTDIR
Additional font dir.

See Also:
Constant Field Values

PARAM_LOAD_BACKGROUND

public static final java.lang.String PARAM_LOAD_BACKGROUND
Load DXF file in background?

See Also:
Constant Field Values

PARAM_COOKIES

public static final java.lang.String PARAM_COOKIES
Cookies to set for any requests to the server.

See Also:
Constant Field Values

PARAM_APPLET_STATE_CALLBACK

public static final java.lang.String PARAM_APPLET_STATE_CALLBACK
Applet state callback.

See Also:
Constant Field Values

DEFAULT_GUI_DESCR

public static final java.lang.String DEFAULT_GUI_DESCR
The default GUI description used if none is given.

See Also:
Constant Field Values

FLAT_EPSILON

public static final double FLAT_EPSILON
Epsilon to determine if a file is considered flat.

See Also:
Constant Field Values

BT_DISPLAY_FRAME

public static final java.lang.String BT_DISPLAY_FRAME
I18n key for button to show frame.

See Also:
Constant Field Values

ERR_APP_PARSE_READ

public static final java.lang.String ERR_APP_PARSE_READ
I18n key for SAX parser error.

See Also:
Constant Field Values

ERR_APP_CONFIG_PARSER

public static final java.lang.String ERR_APP_CONFIG_PARSER
I18n key for SAX parser configuration error.

See Also:
Constant Field Values

ERR_APP_CONFIG_IO

public static final java.lang.String ERR_APP_CONFIG_IO
I18n key for i/o error while reading configuration.

See Also:
Constant Field Values

ERR_RESTRICT_NO_SAVE

public static final java.lang.String ERR_RESTRICT_NO_SAVE
I18n kex for error message when trying to save in an restricted environment.

See Also:
Constant Field Values

ERR_NO_SAVE_FORMAT

public static final java.lang.String ERR_NO_SAVE_FORMAT
I18n key for error when saving in unsupported format.

See Also:
Constant Field Values

MI_CLOSE_WINDOW

public static final java.lang.String MI_CLOSE_WINDOW
I18n key for menu action close window.

See Also:
Constant Field Values
Constructor Detail

DxfApplet

public DxfApplet()
Constructor.

Method Detail

getGuiDescriptionURL

protected java.net.URL getGuiDescriptionURL(java.lang.String defaultDescr)
Get the URL describing the GUI. This is called from the init() method.

Parameters:
defaultDescr - default description to be used if no GUI description is set by user
Returns:
the GUI description URL pointing to an XML GUI description or null if there is no GUI description.

init

public void init()
Called by the browser or applet viewer to inform this applet that it has been loaded into the system. It is always called before the first time that the start method is called.

A subclass of Applet should override this method if it has initialization to perform. For example, an applet with threads would use the init method to create the threads and the destroy method to kill them.

The implementation of this method provided by the Applet class does nothing.

Overrides:
init in class java.applet.Applet
See Also:
Applet.destroy(), Applet.start(), Applet.stop()

getProgressReadColor

public java.awt.Color getProgressReadColor()
Get the color for the progress bar during file read.

Returns:
file read progress color

setProgressReadColor

public void setProgressReadColor(java.awt.Color progressReadColor)
Set the color for the progress bar during file read.

Parameters:
progressReadColor - file read progress color

getProgressWriteColor

public java.awt.Color getProgressWriteColor()
Get the color for the progress bar during file write.

Returns:
file write progress color

setProgressWriteColor

public void setProgressWriteColor(java.awt.Color progressWriteColor)
Set the color for the progress bar during file write.

Parameters:
progressWriteColor - file write progress color

loadDxfFile

public void loadDxfFile(java.lang.String location)
Load a DXF file into the applet. If the applet displays more tabs with files (currently supported only for frame version), the file is loaded into the current tab, replacing what is already displayed there.

Parameters:
location - URL to the file, absolute or relative to document base.

loadDxfFile

public void loadDxfFile(java.lang.String location,
                        boolean addToCurrent)
Load a DXF file into the applet.

Parameters:
location - URL to the file, absolute or relative to document base
addToCurrent - add the new model to the current model instead of replacing it? This is currently only supported in framed mode.

getPrintMode

public PrintMode getPrintMode()
Get the current print mode.

Returns:
print mode

setPrintMode

public void setPrintMode(PrintMode printMode)
Set the current print mode.

Parameters:
printMode - print mode

getModelUnit

public PhysicalLength getModelUnit()
Get the currently used model unit. The model unit is used for fix scale printing and paper overlay display

Returns:
model unit

setModelUnit

public void setModelUnit(PhysicalLength modelUnit)
Set the currently used model unit. The model unit is used for fix scale printing and paper overlay display

Parameters:
modelUnit - model unit

destroy

public void destroy()
Called by the browser or applet viewer to inform this applet that it is being reclaimed and that it should destroy any resources that it has allocated. The stop method will always be called before destroy.

A subclass of Applet should override this method if it has any operation that it wants to perform before it is destroyed. For example, an applet with threads would use the init method to create the threads and the destroy method to kill them.

The implementation of this method provided by the Applet class does nothing.

Overrides:
destroy in class java.applet.Applet
See Also:
Applet.init(), Applet.start(), Applet.stop()

showError

public void showError(java.lang.Throwable x)
Show an error for an exception.

Parameters:
x - exception

showError

public void showError(java.lang.String msg)
Show an error dialog.

Parameters:
msg - error message

printAll

public void printAll(java.awt.Graphics g)
Overrides:
printAll in class java.awt.Component

printComponents

public void printComponents(java.awt.Graphics g)
Overrides:
printComponents in class java.awt.Container

print

public void print(java.awt.Graphics g)
Prints the container. This forwards the print to any lightweight components that are children of this container. If this method is reimplemented, super.print(g) should be called so that lightweight components are properly rendered. If a child component is entirely clipped by the current clipping setting in g, print() will not be forwarded to that child. Currently this does not work under Firefox because it is never called. Waiting for the bug to appear in the Bugbase.

Overrides:
print in class java.awt.Container
Parameters:
g - the specified Graphics window
See Also:
Component.update(java.awt.Graphics)

printView

public void printView()
Print the current view. This shows a print dialog to the user, than prints to the selected printer.


copyViewToClipboard

public void copyViewToClipboard()
Copy the current view as a bitmap image to the system clipboard.


doSave

public void doSave(java.lang.String path,
                   java.lang.String format)
            throws java.io.IOException
Save the image in the given format to the given location. It's the helper's responsibility to take care if the file already exists.

Specified by:
doSave in interface ImageSaveHelper
Parameters:
path - the path of the file where to saved
format - the format in which to write
Throws:
java.io.IOException - on errors during output

getLastSaveDir

public java.io.File getLastSaveDir()
Get the last dir where something was saved. This is used as an initial directory for the write dialog.

Specified by:
getLastSaveDir in interface ImageSaveHelper
Returns:
last directory or null for default

getDialogParentFrame

public java.awt.Frame getDialogParentFrame()
Get a frame to be used as a dialog parent for the write dialog.

Specified by:
getDialogParentFrame in interface ImageSaveHelper
Specified by:
getDialogParentFrame in interface VectorSaveHelper
Returns:
parental frame for dialogs

getTemporaryPainter

public TemporaryPainter getTemporaryPainter()
Get a temporary painter which draws the current model.

Specified by:
getTemporaryPainter in interface VectorSaveHelper
Returns:
temporary painter

getPreferences

public java.util.prefs.Preferences getPreferences()
Get the preferences access object.

Specified by:
getPreferences in interface VectorSaveHelper
Returns:
preferences accessor

getViewAspectRatio

public double getViewAspectRatio()
Get the aspect ration of the view.

Specified by:
getViewAspectRatio in interface VectorSaveHelper
Returns:
the aspect ratio of the view (x/y)

getProgressShower

public ProgressShower getProgressShower()
Get the progress shower used for progress display.

Specified by:
getProgressShower in interface VectorSaveHelper
Returns:
progress shower or null if there is no progress display

closeFrame

public void closeFrame()
Hides the frame if it is shown.

See Also:
showFrame()

showFrame

public void showFrame()
Shows the frame if it was hidden. Also puts it to the front.

See Also:
closeFrame()

resetView

public void resetView()
Reset the view to initial state.


goForward

public void goForward()
Go a step forward in history if possible.


goBackward

public void goBackward()
Go a step backward in history if possible.


canGoForward

public boolean canGoForward()
Is it possible to go a step forward in history?

Returns:
the answer

canGoBackward

public boolean canGoBackward()
Is it possible to go a step backward in history?

Returns:
the answer

getLayerNames

public java.lang.String[] getLayerNames()
Get the names of the layers in the current model. This method is doing nothing when using a standard DXF Viewer frame.

Returns:
layer names

isLayerVisible

public boolean isLayerVisible(java.lang.String layerName)
Is a given layer visible? This method is doing nothing when using a standard DXF Viewer frame.

Parameters:
layerName - layer name
Returns:
true: the layer is visible
false: the layer is invisible

setLayerVisible

public void setLayerVisible(java.lang.String layerName,
                            boolean visible)
Set the visibility of a given layer. This method is doing nothing when using a standard DXF Viewer frame.

Parameters:
layerName - layer name
visible - true: set the layer visible
false: set the layer invisible

saveView

public void saveView(java.lang.String format)
Save the current view in a given format. Because access to the file system is needed this will only work for signed applets.

Parameters:
format - format shortcut for saving, at least gif, jpg, pdf, ps and svg

getAppletState

public SimpleAppletState getAppletState()
Get the current applet state.

Returns:
applet state

setSearchText

public int setSearchText(java.lang.String text)
Set the search text. It does highlight matching texts, but is not actually displaying one. This will only work if there is a text search action defined and the applet state is SimpleAppletState.Displaying.

Parameters:
text - text to search for
Returns:
number of matches, or -1: no search action found

getSearchText

public java.lang.String getSearchText()
Get the current search text. This will only work if there is a text search action defined and the applet state is SimpleAppletState.Displaying.

Returns:
search text or null if there is no search action

setSearchSettings

public int setSearchSettings(boolean backward,
                             boolean caseSensitive,
                             boolean matchWords)
Set various settings for searching. This will only work if there is a text search action defined and the applet state is SimpleAppletState.Displaying.

Parameters:
backward - search backward?
caseSensitive - search case sensitive?
matchWords - search only whole words?
Returns:
number of matches, or -1: no search action found

searchNext

public int searchNext()
Perform a search. This will move to the next match. This will only work if there is a text search action defined, a search text is defined and the applet state is SimpleAppletState.Displaying.

Returns:
current match number (1 to total number of matches) if there is any match at all, 0 if there are no matches, and -1 if there is no search action

getNumberOfSearchMatches

public int getNumberOfSearchMatches()
Get the number of matches for the current search text. This will only work if there is a text search action defined and the applet state is SimpleAppletState.Displaying.

Returns:
number of matches or -1 if there is no search action defined

getCurrentMatchIndex

public int getCurrentMatchIndex()
Get the number of matches for the current search text. This will only work if there is a text search action defined and the applet state is SimpleAppletState.Displaying.

Returns:
current match number (1 to total number of matches) if there is any match at all, 0 if there are no matches, and -1 if there is no search action

getAppletInfo

public java.lang.String getAppletInfo()
Returns information about this applet. An applet should override this method to return a String containing information about the author, version, and copyright of the applet.

The implementation of this method provided by the Applet class returns null.

Overrides:
getAppletInfo in class java.applet.Applet
Returns:
a string containing information about the author, version, and copyright of the applet.

getParameterInfo

public java.lang.String[][] getParameterInfo()
Returns information about the parameters that are understood by this applet. An applet should override this method to return an array of Strings describing these parameters.

Each element of the array should be a set of three Strings containing the name, the type, and a description. For example:

 String pinfo[][] = {
         {"fps",    "1-10",    "frames per second"},
         {"repeat", "boolean", "repeat image loop"},
         {"imgs",   "url",     "images directory"}
 };
 

The implementation of this method provided by the Applet class returns null.

Overrides:
getParameterInfo in class java.applet.Applet
Returns:
an array describing the parameters this applet looks for.