|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsimtools.shapes.AbstractShape
jsynoptic.builtin.Abstract1DShape
jsynoptic.builtin.Abstract2DShape
jsynoptic.plugins.svg.SvgShape
public class SvgShape
Class .SvgShape svg shape will draw an image (how suprising!) based on a svg file It will use SVGImageFactory to handle images and svg files
Nested Class Summary | |
---|---|
static class |
SvgShape.SvgShapePropertiesNames
|
Nested classes/interfaces inherited from class jsynoptic.builtin.Abstract2DShape |
---|
Abstract2DShape.Abstract2DShapePropertiesNames |
Nested classes/interfaces inherited from class jsynoptic.builtin.Abstract1DShape |
---|
Abstract1DShape.Abstract1DShapePropertiesNames |
Nested classes/interfaces inherited from class simtools.shapes.AbstractShape |
---|
AbstractShape.AbstractShapePropertiesNames |
Field Summary | |
---|---|
protected boolean |
autoFit
true : the image should be scaled to fit the shape size, else the shape will be resized |
protected java.io.File |
defaultFile
the source file of the bufferedImage displayed by default This field is nice to have for the user, when changing the image => keep the location |
protected boolean |
dirtyImage
boolean to indicate when the DataSource source has changed |
protected java.io.File |
dynamicFile
the source file of the bufferedImage displayed dynamically (by default or by the SvgMapper) |
static SVGImageFactory |
factory
The factory instance |
protected java.awt.image.BufferedImage |
image
image : reference to the BufferedImage in the ImageHolder Class |
protected long |
index
The index in the data source (used or not) |
protected SvgMapper |
mapper
mapper : SvgMapper to manipulate DataSource source |
static java.util.ResourceBundle |
resources
|
static FileSerializer |
serializer
The file serializer instance |
protected DataSource |
source
|
Fields inherited from class jsynoptic.builtin.Abstract2DShape |
---|
dirtyFillColor, fillColor, fillDynamicColor, fillMapper, fillMapperIndex, fillMapperSource |
Fields inherited from class jsynoptic.builtin.Abstract1DShape |
---|
allowResize, bounds2D, delegateEndNotificationListener, dirty, dirtyDrawColor, dirtyRectangle, drawColor, drawDynamicColor, drawMapper, drawMapperIndex, drawMapperSource, fixedRatio, link, MIN_SIZE, ratio, stroke, strokeParams, transform |
Fields inherited from class simtools.shapes.AbstractShape |
---|
_h, _ox, _oy, _propertyNames, _w, _x, _y, ANTI_ALIASING, currentDialogBox, FONT_NAMES, listeners, REFRESH_PERIOD |
Fields inherited from interface jsynoptic.base.ContextualActionProvider |
---|
EDITOR_CONTEXT, MOUSE_OUT_CONTEXT, MOUSE_OVER_CONTEXT, MOUSE_PRESSED_CONTEXT, SHAPELIST_CONTEXT, SOURCELIST_CONTEXT |
Constructor Summary | |
---|---|
SvgShape(int ox,
int oy,
int width,
int height)
|
Method Summary | |
---|---|
protected AbstractShape |
cloneShape()
Performs a copy of the shape This method has to be overriden to deal with concrete shapes |
JPropertiesPanel |
createPanel()
|
void |
DataSourceIndexRangeChanged(DataSource ds,
long startIndex,
long lastIndex)
Called when the range of valid index changed |
void |
DataSourceReplaced(DataSource oldData,
DataSource newData)
Called when a data source is replaced by another one |
void |
DataSourceValueChanged(DataSource ds,
long minIndex,
long maxIndex)
Called when at least a value changed in the data source. |
void |
done(java.awt.image.BufferedImage img)
If the loading is successful as well as the painting then the resulting image is provided to the caller |
protected void |
drawHook(java.awt.Graphics2D g,
boolean shapeDrawn)
For subclasses, called before restoring original graphics properties, after the delegate shape is drawn if shapeDrawn is true, or after saving the current context, before the delegate shape is drawn if shapeDrawn is false |
void |
failed(java.lang.String msg)
If the loading is not successful or the painting then the error message is provided to the caller |
protected java.awt.Shape |
getDelegateShape()
|
protected java.io.File |
getDynamicSvgFile()
|
java.lang.String[] |
getPropertyNames()
Get the list of property names |
java.lang.Object |
getPropertyValue(java.lang.String name)
Get the value of the property named name |
protected java.lang.Object |
getSourceValue()
|
boolean |
isAutoFit()
If the image should be scaled to fit the shape size (autoFit true), else the shape will be resized |
void |
notificationEnd(java.lang.Object referer)
This callback is called after all notifications were processed. |
void |
removeListener(ShapeListener sl)
|
void |
resize(int dx,
int dy)
Resize the component |
void |
setAutoFit(boolean autoFit)
If the image should be scaled to fit the shape size (autoFit true), else the shape will be resized |
void |
setPropertyValue(java.lang.String name,
java.lang.Object value)
Assigns value to the property named name |
void |
wipeOff()
Wipe-off all all buffered resources in order to refresh shape. |
Methods inherited from class jsynoptic.builtin.Abstract2DShape |
---|
createPanel, draw, fillHook, getFillColor, setDelegateEndNotificationListener |
Methods inherited from class jsynoptic.builtin.Abstract1DShape |
---|
canDoAction, canResize, contains, contains, contains, contains, DataSourceInfoChanged, DataSourceOrderChanged, DataSourceValueRangeChanged, doAction, doCollectiveAction, getActions, getBounds, getBounds2D, getCollectiveActions, getDelegateEndNotificationListener, getDrawColor, getDx, getDy, getLink, getPathIterator, getPathIterator, intersects, intersects, setAnchor, setLink, translate, updateBounds, updateTransform |
Methods inherited from class simtools.shapes.AbstractShape |
---|
addListener, getAnchor, getInnerProperties, getMax, getMaxTranslated, getMin, notifyChange, notifyChange, refresh, setAnchor, setProperties |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface simtools.data.DataSourceListener |
---|
DataSourceInfoChanged, DataSourceOrderChanged, DataSourceValueRangeChanged |
Field Detail |
---|
public static java.util.ResourceBundle resources
public static SVGImageFactory factory
public static FileSerializer serializer
protected transient java.awt.image.BufferedImage image
protected transient java.io.File dynamicFile
protected SvgMapper mapper
protected transient DataSource source
protected transient long index
protected transient boolean dirtyImage
protected java.io.File defaultFile
protected boolean autoFit
Constructor Detail |
---|
public SvgShape(int ox, int oy, int width, int height)
ox
- oy
- width
- height
- Method Detail |
---|
public boolean isAutoFit()
public void setAutoFit(boolean autoFit)
protected java.awt.Shape getDelegateShape()
getDelegateShape
in class Abstract1DShape
protected AbstractShape cloneShape()
Abstract2DShape
cloneShape
in class Abstract2DShape
protected void drawHook(java.awt.Graphics2D g, boolean shapeDrawn)
Abstract1DShape
drawHook
in class Abstract1DShape
public JPropertiesPanel createPanel()
createPanel
in class Abstract1DShape
protected java.lang.Object getSourceValue() throws DataException
DataException
protected java.io.File getDynamicSvgFile()
public void notificationEnd(java.lang.Object referer)
EndNotificationListener
notificationEnd
in interface EndNotificationListener
notificationEnd
in class Abstract2DShape
public void DataSourceIndexRangeChanged(DataSource ds, long startIndex, long lastIndex)
DataSourceListener
DataSourceIndexRangeChanged
in interface DataSourceListener
DataSourceIndexRangeChanged
in class Abstract2DShape
ds
- The data source that changedstartIndex
- The new start IndexlastIndex
- The new last indexpublic void DataSourceValueChanged(DataSource ds, long minIndex, long maxIndex)
DataSourceListener
DataSourceValueChanged
in interface DataSourceListener
DataSourceValueChanged
in class Abstract2DShape
ds
- The data source that changedminIndex
- Lower bound of the range where values changedmaxIndex
- Higher bound of the range where values changedpublic void DataSourceReplaced(DataSource oldData, DataSource newData)
DataSourceListener
DataSourceReplaced
in interface DataSourceListener
DataSourceReplaced
in class Abstract2DShape
public void resize(int dx, int dy)
Resizable
resize
in interface Resizable
resize
in class Abstract1DShape
dx
- value on x axisdy
- value on y axispublic java.lang.Object getPropertyValue(java.lang.String name)
AbstractShape
name
getPropertyValue
in interface NamedProperties
getPropertyValue
in class Abstract2DShape
name
- the name of the property to get
AbstractShape.getPropertyValue(String)
public void setPropertyValue(java.lang.String name, java.lang.Object value)
AbstractShape
value
to the property named name
setPropertyValue
in interface NamedProperties
setPropertyValue
in class Abstract2DShape
name
- the name of the property to getvalue
- its new valueAbstractShape.setPropertyValue(String, Object)
public void done(java.awt.image.BufferedImage img)
SVGImageFactory.FactoryListener
done
in interface SVGImageFactory.FactoryListener
img
- the resulting imagepublic void failed(java.lang.String msg)
SVGImageFactory.FactoryListener
failed
in interface SVGImageFactory.FactoryListener
msg
- the error messagepublic void removeListener(ShapeListener sl)
removeListener
in class AbstractShape
public java.lang.String[] getPropertyNames()
NamedProperties
getPropertyNames
in interface NamedProperties
getPropertyNames
in class Abstract2DShape
public void wipeOff()
AbstractShape
wipeOff
in class AbstractShape
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |