DXF Applet GUI Description File Format
This is a description of the file format used for describing the applet
GUI in the DXF applet. Please note that there are some example files
which may be easier to understand or at least adopt to your needs than
this reference:
- Default.xml: 2D view with toolbar,
statusbar, layer panel, additional toolbar items and (in frame mode)
menu
- OnlyModel.xml: Showing just the
model, with a simplified 2D view.
The file format is XML based. The root tag is dxfapplet.
Some attributes may be internationalized. This is indicated by an i18n
tag wrapped in ${ and },
i. e. ${tag}. If no predefined tag from the
embedded applet's resources is used a resource has to be provided via a
resource bundle class or property files which can be loaded by the applet
from jars or from the codebase. Use the resourcebase applet tag
for this resource to make the resource known to the applet.
See Internationalization Support for more info.
The are various tags defining the components of the GUI. They have each
special attributes, but they also have attributes which are common and
may be used on each of the components. They are described here:
Common Attributes
- pos
Defines the positioning of the component in its
parent container. The exact meaning of the value depends on the parent.
In a tabbedpane parent it defines
the name of the tab, so it may contain any text, and even be
internationalized.
In a splitpane parent the
possible values are (case is ignored)
Top | Top component. |
Bottom | Bottom component. |
Left | Left component. |
Right | Right component. |
All other containers use a java.awt.BorderLayout
so the possible values are (case is ignored):
Center | In center. |
North | At top. |
South | At bottom. |
West | At left. |
East | At right. |
- border
Defines the border of the component. The transformation is
straight forward from the BorderFactory.createXY() methods, so
you should use them as a reference. The border to be used is defined
as a border name (a shortcut derived from these createXY() methods)
with arguments in parenthesis. Because some borders may have other
borders as argument the definition is recursive. Case and extra
whitespace is ignored.
Border definition | Description |
bevel(type)
bevel(type,highlightColor,shadowColor)
bevel(type,highlightOuterColor,highlightInnerColor,shadowOuterColor,shadowInnerColor)
|
Bevel border. The type argument has two
possible values:
The color values may be either given as a name
like white or a HTML-like color definition
like #RRGGBB or
rgb(r,g,b).
|
compound(border1,border2) |
Compound border. The border arguments are just definitions of
other borders.
|
empty()
empty(top,left,bottom,right)
|
Empty border. The first version uses standard margins, the second
version allows to define each margin as a integer number giving
the distance in pixels.
|
etched()
etched(highlightColor,shadowColor)
etched(type)
etched(type,highlightColor,shadowColor)
|
Etched border. The first version uses standard settings,
the highlightColor
and shadowColor arguments allow to define the
colors either as a name
like white or a HTML-like color definition
like #RRGGBB
or rgb(r,g,b). The type argument has
two possible values:
|
line(color)
line(color,thickness)
|
Line border. The color parameter defines the color of the line either as a name
like white or a HTML-like color definition
like #RRGGBB
or rgb(r,g,b). The thickness argument
is an integer number defining the line width in pixels.
|
loweredbevel()
|
Lowered bevel border using the components color for highlight and shadow.
|
matte(top,left,bottom,right,color)
|
Matte border. The first four parameters define the margins, the
last the color either as a name
like white or a HTML-like color definition
like #RRGGBB or rgb(r,g,b).
The icon version of the matte border is not yet supported.
|
raisedbevel()
|
Raised bevel border using the components color for highlight and shadow.
|
titled(title)
titled(border,title)
titled(border,title,justification,position)
|
Titled border. The title has to be enclosed in
single quotes. It may be internationalized.
The border is just another
border definition. The possible values
for justification are
(compare TitledBorder documentation):
- left
- right
- center
- leading
- trailing
- default
The possible values for position are
- above_top
- top
- below_top
- above_bottom
- bottom
- below_bottom
- default
|
- fg
Defines the foreground color of the component.
The color value may be either given as a name like
white
or a HTML-like color definition like
#RRGGBB
or rgb(r,g,b).
Because colors are not inhereted by subcomponents this is only useful
for simple components. See the res tags
in the gui section for a
more powerful (but complicated) access to the settings of the
underlying Swing system resources.
- bg
Defines the background color of the component.
The color value may be either given as a name like
white
or a HTML-like color definition like
#RRGGBB
or rgb(r,g,b).
Because colors are not inhereted by subcomponents this is only useful
for simple components. See the
res tags
in the gui section for a
more powerful (but complicated) access to the settings of the
underlying Swing system resources.
Components and other tags
The rest of this page is a description of the possible XML-Tags,
which mostly define components to insert into the GUI. The root tag
is dxfapplet. Here is a short
overview:
action |
Definition of actions to be used as menu entries. |
dxfapplet |
The root tag. |
label |
Inserts a javax.swing.JLabel component. |
layerpanel |
Adds a panel for layer visibility manipulation. |
menu |
Definition of a menu. |
menubar |
Definition of the menu bar. |
modelmap |
Inserts a model map showing the current viewport (only 2D). |
modelview |
Adds a DXF model view component. |
panel |
Inserts a javax.swing.JPanel component. |
projectionpanel |
Inserts a panel for projection manipulation. |
res |
Overwritten Swing UI resource. |
separator |
Separator in menus. |
splitpane |
Inserts a javax.swing.JSplitPane component. |
statusbar |
Adds a status bar. |
tabbedpane |
Inserts a javax.swing.JTabbedPane component. |
ui |
Overwrite Swing UI resources. |
viewselect |
Insert a view selection panel. |
The root of the XML tree.
Attributes
- frametitle
Defines the title of the frame if not running
in page. May be internationalized.
The result may contain the following place holders:
%0 | Full name of DXF file displayed. |
%1 | Base name of DXF file displayed. |
%2 | Applet version. |
Contained Tags
Surrounding Tags
This is the root, it is therefore not contained in any tags.
Contains UI resource setting for Swing.
Attributes
No attributes defined.
Contained Tags
Surrounding Tags
UI resource setting for Swing.
Attributes
- key
The key of the UI resource. For a list of known resource names and
their default values see UI resources.
Either this attribute or the mask attribute has to be given.
- mask
A globbing mask selecting several UI resource keys.
For a list of known resource names and
their default values see UI resources.
Either this attribute or the key attribute has to be given.
Sets all matching keys to the value given, but it may not be possible
to convert the value in each case (eg if the mask selects colors and
boolean values).
In the globbing mask you can use the following special characters (note
that all comparisions are case sensitive):
* |
Stands for any number of characters, including none. Probably the
most useful match character.
|
? |
Stands for any character.
|
[SET] |
Defines a matching set of characters. SET may contain
several concatenated characters like ABC (matching one
of A, B, or C) or a range a characters
denoted by eg A-C, which defines the same set. The
Unicode order is used. If a - or a ] has to be
included in the set if has to be the first character in the set.
|
[^SET] |
Defines a matching set of not allowed characters. SET may contain
several concatenated characters like ABC (matching
everything else but A, B, or C)
or a range a characters denoted by eg A-C, which defines
the same set. The Unicode order is used.
If a - or a ] has to be
included in the set if has to be the first character in the set.
|
other |
Any other character just stands for itself.
|
Examples:
- *.background selects all background colors
- *Button.background selects the background colors of
Button, RadioButton and ToggleButton
- value
Defines the value to be set. Because the value has to be converted into
a form Swing understands not every possible value type is
supported. Supported types are:
Color |
The color value may be either given as a name like white
or a HTML-like color definition like #RRGGBB
or rgb(r,g,b).
|
Border |
See the border attribute description.
|
String |
The value is used directly.
|
Integer |
A number without a dot.
|
Float |
A number with an optional dot.
|
Boolean |
One of the values true or false.
|
Gradient |
Two floats and three colors, separated by commas. Use a color
name like white or the HTML-like color
definition
#RRGGBB.
|
Dimension |
Two integers (width and height), separated by a comma.
|
Insets |
Four integers (top, left, bottom, right), separated by commas.
|
Fonts |
Font definition for
the java.awt.Font.decode() method:
fontfamilyname-style-pointsize.
|
Arrays |
It is possible to define arrays of values of the above types by
concatenating them with a bar sign |.
|
Contained Tags
No contained tags defined.
Surrounding Tags
Defines the menubar when running in frame mode. In inpage mode this is
not used. May appear only once.
Attributes
No attributes defined.
Contained Tags
Surrounding Tags
Defines a menu or a sub menu.
Attributes
- name
Gives the name of the menu. May be internationalized.
- mnemo
Gives the mnemonic of the menu. May be internationalized.
- tag
Only if name attribute is not given: defines an I18n tag from
which the menu name, mnemonic etc is created.
Contained Tags
Surrounding Tags
Inserts one or more actions into a menu.
Attributes
- name
Gives the name of the action.
The following actions are defined:
Name | Action | Basic I18n Resource Key Prefix |
print | Print view action | miPrint |
close | Close window action | miCloseWindow |
imgsave | All actions for saving on images
(may depend on environment) | actionSaveImage
(fills placeholder %0 with uppercase image format) |
savebmp | Save view as BMP action (contained
in imgsave). | actionSaveImage
(fills placeholder %0 with uppercase image format) |
savegif | Save view as GIF action (contained
in imgsave). | actionSaveImage
(fills placeholder %0 with uppercase image format) |
savejpg | Save view as JPG action (contained
in imgsave). | actionSaveImage
(fills placeholder %0 with uppercase image format) |
savepng | Save view as PNG action (contained
in imgsave). | actionSaveImage
(fills placeholder %0 with uppercase image format) |
savepdf | Save view as PDF action. | actionSavePDF |
saveps | Save view as Postscript action. | actionSavePostscript |
savesvg | Save view as SVG
action. | actionSaveSVG |
paper(paperName,color,plc) |
Shows a paper size indicator. This will only make sense if scaled
printing is enabled. For paperName there are
the following possibilities:
A0 | A0 paper format |
A1 | A1 paper format |
A2 | A2 paper format |
A3 | A3 paper format |
A4 | A4 paper format |
A5 | A5 paper format |
B0 | B0 paper format |
B1 | B1 paper format |
B2 | B2 paper format |
B3 | B3 paper format |
B4 | B4 paper format |
B5 | B5 paper format |
Letter | Letter paper format |
Legal | Legal paper format |
Executive | Executive paper format |
Tabloid | Tabloid paper format |
The color of the overlay may be either given as a name
like white or a HTML-like color definition
like #RRGGBB,
rgb(r,g,b)
or rgba(r,g,b,a).
The last parameter plc describes the kind of overlay
and allows for special settings and grouping:
c | Displays a cross at
the paper's center position |
l | Displays a rectangle
of the paper's size in landscape position |
p | Displays a rectangle
of the paper's size in portrait position |
a | Advance orientation
of the switch (if it is unique) to the printer
properties |
m | Try to determine
margin from print properties and show it (works only after
first print) |
The letters may be combined.
If more than one paper action is used actions may be grouped so
that at most one of the actions in the group is active by adding
a group name in brackets to each of the actions in the group,
e.g. p[GROUP1] for a portrait orientation and
l[GROUP1] for a landscape orientation where only one of
both (or none) is displayed.
|
actionPaperSize_P (only portrait)
actionPaperSize_L (only landscape)
actionPaperSize_C (only cross)
actionPaperSize_PC (portrait w/ cross)
actionPaperSize_LC (landscape w/ cross)
...
actionPaperSize_PLC (portrait, landscape and cross)
|
Contained Tags
No contained tags defined.
Surrounding Tags
Inserts a separator into a menu.
Attributes
No attributes defined.
Contained Tags
No contained tags defined.
Surrounding Tags
Inserts a JSplitPane into the surrounding container.
Attributes
All common component attributes are allowed.
- type
Either horizontal (the default) or vertical.
- split
Position of the splitter. Can either be an integer number defining the
splitter position in pixels, or a number followed by a percent
sign % defining a relative splitter position in percent.
Contained Tags
Surrounding Tags
Inserts a status bar into the surrounding container. May only appear once.
Attributes
All common component attributes are allowed.
- version
Version text to display. It may be internationalized.
- mailto
Mail address to display. It may be internationalized.
- withmem
true: add a memory usage display
false: don't add a memory usage display
- msgfg
Text color for standard messages.
The color value may be either given as a name like
white
or a HTML-like color definition like #RRGGBB
or rgb(r,g,b).
- warnfg
Text color for warnings.
The color value may be either given as a name like
white
or a HTML-like color definition like #RRGGBB
or rgb(r,g,b).
- memwarnbg
Background color for memory warnings.
The color value may be either given as a name like
white
or a HTML-like color definition like #RRGGBB
or rgb(r,g,b).
- memprewarnbg
Background color for nearing memory warning state.
The color value may be either given as a name like
white
or a HTML-like color definition like #RRGGBB
or rgb(r,g,b).
- progressreadfg
Color of progress bar while reading.
The color value may be either given as a name like
white
or a HTML-like color definition like #RRGGBB
or rgb(r,g,b).
- progresswritefg
Color of progress bar while writing.
The color value may be either given as a name like
white
or a HTML-like color definition like #RRGGBB
or rgb(r,g,b).
- withpos
true: add a position display (only for 2D views)
false: don't add a position display
Contained Tags
No contained tags defined.
Surrounding Tags
Inserts a panel for setting the layers of the model visible or
invisible into the surrounding container.
Attributes
All common component attributes are allowed.
- invert
Text to display on Invert button. It may be internationalized.
- selectall
Text to display on Select All button. It may be internationalized.
- showcolor
Show the layer color along with the layer name? true or false
- showcolorvalue
Show the value of the layer color along with the layer name? Only used
if showcolor is true.
Allowed values are true or false
Contained Tags
No contained tags defined.
Surrounding Tags
Inserts a panel with BorderLayout into the surrounding container.
Attributes
No attributes defined.
Contained Tags
Surrounding Tags
Inserts a label into the surrounding container.
Attributes
All common component attributes are allowed.
- text
Text of the label. It may be internationalized.
- align
Alignment of the label. Possible values are:
Contained Tags
No contained tags defined.
Surrounding Tags
Inserts a panel allowing to select various views. It is only defined for
3D views, i.e. the value of the attribute
type of the
modelview
tag has to be 3D+.
Attributes
All common component attributes are
allowed.
Contained Tags
No contained tags defined.
Surrounding Tags
Inserts a panel allowing to manipulate the projection.
It is only defined for 3D views, i.e. the value of the attribute
type of the
modelview
tag has to be 3D+.
Attributes
All common component attributes are
allowed.
Contained Tags
No contained tags defined.
Surrounding Tags
Inserts a component showing the complete model and the current viewport
as it is displayed in the modelview.
It is only defined for 2D views, i.e. the value of the attribute
type of the
modelview
tag has to be 2D, 2D+,
2D3D, or 2D3D+.
Attributes
All common component attributes are
allowed.
- dampcolor
Color used to overlay the part of the model which is not displayed.
It can be any color value (see other attributes below), but for
best effect use a transparent color
like rgba(r,g,b,a) with r, g, b, and a in the
range from 0 to 255. The default value if this attribute is not given is
rgba(128,128,128,128).
- bgcolor
Background color of the component.
The value may be either given as a name like
white or a HTML-like color definition
like #RRGGBB
or rgb(r,g,b). The default value used if this
attribute is not given is black.
- bordercolor
Border color surrounding the current viewport.
The value may be either given as a name like
white or a HTML-like color definition
like #RRGGBB
or rgb(r,g,b). The default value used if this
attribute is not given is white.
- monocolor
Monochrome color used to display the model.
The value may be either given as a name like
white or a HTML-like color definition
like #RRGGBB
or rgb(r,g,b).
If this attribute is not given the original model colors are used.
Contained Tags
No contained tags defined.
Surrounding Tags
Inserts a javax.swing.JTabbedPane component.
Attributes
All common component attributes are
allowed.
- tabplacement
Tab placement:
top |
Place tabs at top side. |
bottom |
Place tabs at bottom side. |
left |
Place tabs at left side. |
right |
Place tabs at right side. |
- tablayout
Tab layout when tabs do not fit:
wrap |
Wrap tabs into new row/column. |
scroll |
Show scroll arrows. |
- bgcolor
Background color of the component.
The value may be either given as a name like
white or a HTML-like color definition
like #RRGGBB
or rgb(r,g,b). The default value used if this
attribute is not given is black.
- bordercolor
Border color surrounding the current viewport.
The value may be either given as a name like
white or a HTML-like color definition
like #RRGGBB
or rgb(r,g,b). The default value used if this
attribute is not given is white.
- monocolor
Monochrome color used to display the model.
The value may be either given as a name like
white or a HTML-like color definition
like #RRGGBB
or rgb(r,g,b).
If this attribute is not given the original model colors are used.
The following attributes are only valid if a text search action is
included in the view
- searchbgcolor
Background color of unselected match.
The value may be either given as a name like
white or a HTML-like color definition
like #RRGGBB
or rgb(r,g,b).
Alpha values may be included by using #AARRGGBB
or rgba(r, g, b, a).
The default is yellow.
- searchfgcolor
Foreground color of unselected match.
The value may be either given as a name like
white or a HTML-like color definition
like #RRGGBB
or rgb(r,g,b).
Alpha values may be included by using #AARRGGBB
or rgba(r, g, b, a).
The default is black.
- searchhitbgcolor
Background color of selected match.
The value may be either given as a name like
white or a HTML-like color definition
like #RRGGBB
or rgb(r,g,b).
Alpha values may be included by using #AARRGGBB
or rgba(r, g, b, a).
The default is a light magenta.
- searchhitfgcolor
Foreground color of selected match.
The value may be either given as a name like
white or a HTML-like color definition
like #RRGGBB
or rgb(r,g,b).
Alpha values may be included by using #AARRGGBB
or rgba(r, g, b, a).
The default is black.
- searchinfobgcolor
Background color for the information box near the selected match.
The value may be either given as a name like
white or a HTML-like color definition
like #RRGGBB
or rgb(r,g,b).
Alpha values may be included by using #AARRGGBB
or rgba(r, g, b, a).
The default is #c0ffffff (25% transparent white).
- searchinfofgcolor
Foreground (shortcut for text and border) color for the information box near the selected match.
The value may be either given as a name like
white or a HTML-like color definition
like #RRGGBB
or rgb(r,g,b).
Alpha values may be included by using #AARRGGBB
or rgba(r, g, b, a).
The default is magenta.
- searchinfotextcolor
Text color for the information box near the selected match.
The value may be either given as a name like
white or a HTML-like color definition
like #RRGGBB
or rgb(r,g,b).
Alpha values may be included by using #AARRGGBB
or rgba(r, g, b, a).
The default is magenta.
- searchinfobordercolor
Border color for the information box near the selected match.
The value may be either given as a name like
white or a HTML-like color definition
like #RRGGBB
or rgb(r,g,b).
Alpha values may be included by using #AARRGGBB
or rgba(r, g, b, a).
The default is magenta.
- searchdisplayinfo
Boolean value (true or false) defining
whether an information box should be displayed near the selected match.
The default is true.
- searchbackward
Boolean value (true or false) defining
whether the initial search is going forward (false) or
backward (true). The default is false.
- searchmatchwords
Boolean value (true or false) defining
whether the initial search is matching words (true) or
anything (false). The default is false.
- searchcasesensitive
Boolean value (true or false) defining
whether the initial search is case sensitive (true) or
not (false). The default is false.
- searchminsize
Minimal height of search hit in pixel when stepping through the matches.
The default is 16.
Contained Tags
No contained tags defined.
Surrounding Tags
Inserts the view for the model into the surrounding container. It has to appear once.
Attributes
All common component attributes are allowed.
- type
Model view type:
2D | Simple 2D view, using 2D data. With 2D
data it is not always possible to display all 3D DXF files
correctly, but it uses half as much memory and draws faster.
Use only with 2D files. |
2D+ | 2D view with toolbar, using 2D data. With 2D
data it is not always possible to display all 3D DXF files
correctly, but it uses half as much memory and draws faster.
Use only with 2D files. |
3D+ | 3D view with toolbar, similar to DXF
Viewer with 3D data. |
2D3D | Same as 2D, but using 3D data. This
avoids the problems with incorrect displays while using the
double amount of memory. |
2D3D+ | Same as 2D+, but using 3D data. This
avoids the problems with incorrect displays while using the
double amount of memory. |
- bgcolor
Background color in the view. May be either given as a name
like white or a HTML-like color definition
like #RRGGBB or rgb(r,g,b).
- coordsys
Boolean value (true or false). Display coordinate
system? Only for 3D view.
- coordsyspos
Only for 3D and if coordsys is given. Position of coordinate
system. Possible values are:
NE | Upper right |
NW | Upper left |
SE | Lower right |
SW | Lower left |
- reducemode
How to display the model during movements. Possible values are:
dynamic | Dynamically reduced. Depends on
visible data. (Default) |
static | Statically reduced. Does always draw
a fixed part of the model. |
off | The model is always drawn completely. |
- staticreduce
Number of lines to display in statically reduced mode.
- dynamicreduce
Number of objects to display in dynamically reduced mode.
- antialias
Boolean value (true or false). Use antialiased
drawing?
- skipsize
Pixel size of objects which are skipped during draw operations for
faster drawing. Default: 0.
- skiptextsize
Text height in pixel defining when a box is drawn instead of the text
for faster drawing. Default: 2.
- useltypes
Boolean value (true or false). Display DXF line styles?
- allowpicking
Boolean value (true or false). Allow picking and
displaying information of the picked DXF entity. Because all DXF
information can be discarded if picking is not allowed setting this
option to true results in a larger memory footprint. Picking
is only possible when toolsbars are available, i. e. for
types 2D+, 3D+ and 2D3D+.
- invertwheel
Boolean value (true or false). Invert the zoom effect of
rotation the mouse wheel?
- animation
Number of milliseconds available for animations. Set to 0 to
disable animations.
- scrollbars
Boolean value (true or false). Display scrollbars
when zooming into model (not for 3D+ view).
- states
Only if a toolbar is available, i. e. for
types 2D+, 3D+ and 2D3D+. Allows to switch
toolbar states and actions on and off. Contains a number of state and
action names separated by + (switch state on)
and -
(switch state off) signs. Possible state and action names are:
State Name | Description | Basic I18n Resource
Key Prefix |
all | Mask for all possible states and actions. | n.a. |
zoomin | Zoom in state (dragged rectangle
becomes new view). | zoomInState |
zoomout | Zoom out state (view is put into
dragged rectangle). | zoomOutState |
zoom | Zoom state (dragging mouse zooms around
center). | scaleState |
zoominout | Mask for both zoom in and out states. | n.a. |
zoomall | Mask for all zoom (in, out, by
mouse) states. | n.a. |
movez | Move Z state (move through model by mouse dragging
(only 3D)). | distanceState |
pan | Pan state (drag model with mouse). | panState |
rotate | Rotate state (rotate model with mouse). | rotateState |
picking | Picking state (get information of
picked entity, requires allowpicking attribute to
be true). | pickState |
perspective | Perspective view state (only
3D). | perspectiveState |
projective | Projective view state (only
3D). | projectionState |
viewstates | Mask for perspective and
projective view state | n.a. |
displaymode | Mask for
setting filled and unfilled drawing | n.a. |
reset | Reset view to initial action. |
resetAction (2D)
resetXAction (3D)
resetYAction (3D)
resetZAction (3D)
|
backward | Go back to last view action. |
backwardAction |
forward | Go forward to next view
action. | forwardAction |
history | Mask for reset, backward and forward
actions. | n.a. |
rotateccw | Rotate 90° counterclockwise action. | rotateCcwAction |
rotatecw | Rotate 90° clockwise action. | rotateCwAction |
rotatestep | Mask for rotateccw and rotatecw actions. | n.a. |
fit | Fit to size action. |
fitToSizeAction |
search | Text search action. |
textSearchAction |
- preactions
Actions to be inserted at the beginning of the toolbar. Only if a
toolbar is available, i. e. for
types 2D+, 3D+
and 2D3D+. Contains a comma-separated list of
actions. Possible action names are described in
the action tag. An empty entry indicates a
separator.
- postactions
Actions to be added to the end of the toolbar. Only if a
toolbar is available, i. e. for
types 2D+, 3D+
and 2D3D+. Contains a comma-separated list of
actions. Possible action names are described in
the action tag. An empty entry indicates a
separator.
- initial
Initial state to be set. Possible states are described in
the states attribute. Only if a
toolbar is available, i. e. for
types 2D+, 3D+
and 2D3D+.
Contained Tags
No contained tags defined.
Surrounding Tags