public class IltOPCImageBaseRendererFactory extends IltAbstractImageBaseRendererFactory
Note: Image processing is carried out only when necessary. This means that when a new type is defined, no memory or CPU is used. The real processing and memory allocation are performed only when the first time the image is drawn.
You can easily create a new Off-Page connector with the following code:
IltOffPageConnector.Type newType = new IltOffPageConnector.Type(YOUR_NEW_TYPE_NAME); try { Image img = null; URL url = new URL("file", "", YOUR_IMAGE_FILE_NAME); img = getImage(url); if (img != null) { IltOPCImageBaseRendererFactory factory = new IltOPCImageBaseRendererFactory(img, YOUR_IMAGE_PARAMETERS ); IltSettings.SetValue("OffPageConnector.Type.YOUR_NEW_TYPE_NAME.Renderer", factory); } } catch (Exception e) { e.printStackTrace(); }
Note: YOUR_NEW_TYPE_NAME
should be replaced with
any String you want.
YOUR_IMAGE_FILE_NAME
should be replaced with the appropriate String
to create a URL object for your image.
YOUR_IMAGE_PARAMETERS
is optional.
To obtain YOUR_IMAGE_PARAMETERS
, follow these steps:
samples/framework/imagecolortuner/
directory of JTGO.
The parameters are the same as for IltNetworkElement objects.
IltOffPageConnector.Type
,
IltSettings
,
IltOPCBaseRenderer
Modifier and Type | Class and Description |
---|---|
protected static class |
IltOPCImageBaseRendererFactory.BaseRenderer
This implementation of BaseRenderer can draw a modified version of the
sourceImage (given as parameter of the constructor of
the BaseRenderer factory) according to the baseStyle and
alarms of the object that is represented. |
Constructor and Description |
---|
IltOPCImageBaseRendererFactory()
Creates a new
IltOPCImageBaseRendererFactory . |
IltOPCImageBaseRendererFactory(Image sourceImage)
Creates a new
IltOPCImageBaseRendererFactory . |
IltOPCImageBaseRendererFactory(Image sourceImage,
int brightThreshold,
int darkThreshold,
int normGray)
Creates a new
IltOPCImageBaseRendererFactory . |
IltOPCImageBaseRendererFactory(Image sourceImage,
int brightThreshold,
int darkThreshold,
int normGray,
boolean dottedBorderVisible)
Creates a new
IltOPCImageBaseRendererFactory . |
IltOPCImageBaseRendererFactory(String sourceImageName,
int brightThreshold,
int darkThreshold,
int normGray,
boolean dottedBorderVisible)
Creates a new
IltOPCImageBaseRendererFactory . |
Modifier and Type | Method and Description |
---|---|
protected IltBaseRenderer |
createBaseRenderer()
This method can be overridden to create the
real base renderer that displays the image.
|
createValue, getBrightThreshold, getDarkThreshold, getGrayLevel, getImageFactory, getSourceImage, getSourceImageName, isDottedBorderVisible, isPolygonalBorder, setBrightThreshold, setDarkThreshold, setDottedBorderVisible, setGrayLevel, setPolygonalBorder, setSourceImage, setSourceImageName
public IltOPCImageBaseRendererFactory(Image sourceImage, int brightThreshold, int darkThreshold, int normGray)
IltOPCImageBaseRendererFactory
.sourceImage
- The image that will be processed to create the
different BaseStyle representations.brightThreshold
- The threshold (0..255) used for bright colors
when computing the NoTraffic representation.darkThreshold
- The threshold (0..255) used for dark colors when
computing the NoTraffic representation.normGray
- The gray level (0..255) used when computing the
alarmed CarryingTraffic representation.public IltOPCImageBaseRendererFactory(Image sourceImage, int brightThreshold, int darkThreshold, int normGray, boolean dottedBorderVisible)
IltOPCImageBaseRendererFactory
.sourceImage
- The image that will be processed to create
the different BaseStyle representations.brightThreshold
- The threshold (0..255) used for bright
colors when computing the NoTraffic
representation.darkThreshold
- The threshold (0..255) used for dark colors
when computing the NoTraffic representation.normGray
- The gray level (0..255) used when computing
the alarmed CarryingTraffic representation.dottedBorderVisible
- Indicates whether an additional dotted border
should be drawn around the base.IltBaseRenderer.isDottedBorderVisible()
public IltOPCImageBaseRendererFactory(String sourceImageName, int brightThreshold, int darkThreshold, int normGray, boolean dottedBorderVisible)
IltOPCImageBaseRendererFactory
.sourceImageName
- The image that will be processed to create
the different BaseStyle representations.brightThreshold
- The threshold (0..255) used for bright colors
when computing the NoTraffic representation.darkThreshold
- The threshold (0..255) used for dark colors
when computing the NoTraffic representation.normGray
- The gray level (0..255) used when computing
the alarmed CarryingTraffic representation.dottedBorderVisible
- Indicates whether an additional dotted border
should be drawn around the base.IltBaseRenderer.isDottedBorderVisible()
public IltOPCImageBaseRendererFactory(Image sourceImage)
IltOPCImageBaseRendererFactory
.
Using this constructor is equivalent to
IltOPCImageBaseRendererFactory(sourceImage, 200, 50, 128, false)
.
sourceImage
- The image that will be processed to create
the different BaseStyle representations.public IltOPCImageBaseRendererFactory()
IltOPCImageBaseRendererFactory
.
The following default values are used:
200
50
128
false
The source image must be specified using method
IltAbstractImageBaseRendererFactory.setSourceImage(Image)
or IltAbstractImageBaseRendererFactory.setSourceImageName(String)
before using this renderer factory.
The renderer factory parameters shall be specified before using this renderer factory for the first time. Once the renderer factory is in use, modifying these parameters will have no effect on the object representation.
IltAbstractImageBaseRendererFactory.setSourceImage(Image)
,
IltAbstractImageBaseRendererFactory.setSourceImageName(String)
,
IltAbstractImageBaseRendererFactory.setBrightThreshold(int)
,
IltAbstractImageBaseRendererFactory.setDarkThreshold(int)
,
IltAbstractImageBaseRendererFactory.setGrayLevel(int)
,
IltAbstractImageBaseRendererFactory.setDottedBorderVisible(boolean)
protected IltBaseRenderer createBaseRenderer()
IltAbstractImageBaseRendererFactory
This method is called by IltAbstractImageBaseRendererFactory.createValue()
.
createBaseRenderer
in class IltAbstractImageBaseRendererFactory
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.