Java源码示例:com.l2fprod.common.beans.ExtendedPropertyDescriptor
示例1
public LayoutScaleBarBeanBeanInfo() {
super(LayoutScaleBarBean.class);
ExtendedPropertyDescriptor e = addProperty("scaleBarType");
e.setCategory("General").setDisplayName("Scale Bar Type");
e.setPropertyEditorClass(ScaleBarTypeEditor.class);
addProperty("drawBackColor").setCategory("General").setDisplayName("Draw Background");
addProperty("backColor").setCategory("General").setDisplayName("Background");
addProperty("foreColor").setCategory("General").setDisplayName("Foreground");
addProperty("font").setCategory("General").setDisplayName("Font");
addProperty("drawScaleText").setCategory("General").setDisplayName("Draw Scale Text");
addProperty("drawNeatLine").setCategory("Neat Line").setDisplayName("Draw Neat Line");
addProperty("neatLineColor").setCategory("Neat Line").setDisplayName("Neat Line Color");
addProperty("neatLineSize").setCategory("Neat Line").setDisplayName("Neat Line Size");
addProperty("left").setCategory("Location").setDisplayName("Left");
addProperty("top").setCategory("Location").setDisplayName("Top");
addProperty("width").setCategory("Location").setDisplayName("Width");
addProperty("height").setCategory("Location").setDisplayName("Height");
}
示例2
public ImageLayerBeanBeanInfo() {
super(ImageLayerBean.class);
addProperty("fileName").setCategory("Read only").setReadOnly().setDisplayName("File name");
addProperty("layerType").setCategory("Read only").setReadOnly().setDisplayName("Layer type");
addProperty("layerDrawType").setCategory("Read only").setReadOnly().setDisplayName("Layer draw type");
addProperty("handle").setCategory("Read only").setReadOnly().setDisplayName("Handle");
addProperty("layerName").setCategory("Editable").setDisplayName("Layer name");
addProperty("visible").setCategory("Editable").setDisplayName("Visible");
addProperty("maskout").setCategory("Editable").setDisplayName("Is maskout");
addProperty("transparency").setCategory("Editable").setDisplayName("Transparency Percent");
addProperty("useTransColor").setCategory("Editable").setDisplayName("If use transparency color");
addProperty("transparencyColor").setCategory("Editable").setDisplayName("Transparency color");
addProperty("xScale").setCategory("Editable").setDisplayName("X scale");
addProperty("yScale").setCategory("Editable").setDisplayName("Y scale");
addProperty("xUL").setCategory("Editable").setDisplayName("X upper left");
addProperty("yUL").setCategory("Editable").setDisplayName("Y upper left");
addProperty("xRotate").setCategory("Editable").setDisplayName("X rotate");
addProperty("yRotate").setCategory("Editable").setDisplayName("Y rotate");
ExtendedPropertyDescriptor e = addProperty("interpolation");
e.setCategory("Editable").setPropertyEditorClass(InterpolationEditor.class);
e.setDisplayName("Interpolation");
}
示例3
public LayoutLegendBeanBeanInfo() {
super(LayoutLegendBean.class);
ExtendedPropertyDescriptor e = addProperty("plotOrientation");
e.setCategory("General").setDisplayName("Plot orientation");
e.setPropertyEditorClass(PlotOrientationEditor.class);
addProperty("tickFont").setCategory("General").setDisplayName("Tick Font");
addProperty("drawBackground").setCategory("General").setDisplayName("Draw Background");
addProperty("background").setCategory("General").setDisplayName("Background");
addProperty("columnNumber").setCategory("General").setDisplayName("Column Number");
addProperty("drawNeatLine").setCategory("Neat Line").setDisplayName("Draw Neat Line");
addProperty("neatLineColor").setCategory("Neat Line").setDisplayName("Neat Line Color");
addProperty("neatLineSize").setCategory("Neat Line").setDisplayName("Neat Line Size");
}
示例4
public MaskOutBeanBeanInfo() {
super(MaskOut.MaskOutBean.class);
ExtendedPropertyDescriptor e = addProperty("maskLayer");
e.setCategory("General").setPropertyEditorClass(MaskOut.LayerNameEditor.class);
e.setDisplayName("Layer Name");
e.setShortDescription("The name of the layers can be used as maskout");
e = addProperty("mask");
e.setCategory("General").setDisplayName("Is Maskout");
}
示例5
public LayoutLegendBeanBeanInfo() {
super(LayoutLegendBean.class);
ExtendedPropertyDescriptor e = addProperty("layerName");
e.setCategory("General").setPropertyEditorClass(LayerNameEditor.class);
e.setDisplayName("Layer Name");
e.setShortDescription("The name of the layer of this legend");
e = addProperty("layerUpdateType");
e.setCategory("General").setDisplayName("Layer Update Type");
e.setPropertyEditorClass(LayerUpdateTypeEditor.class);
e = addProperty("legendStyle");
e.setCategory("General").setDisplayName("Legend Style");
e.setPropertyEditorClass(LegendStyleEditor.class);
addProperty("title").setCategory("General").setDisplayName("Title");
addProperty("font").setCategory("General").setDisplayName("Font");
addProperty("drawBackColor").setCategory("General").setDisplayName("Draw Background");
addProperty("backColor").setCategory("General").setDisplayName("Background");
addProperty("foreColor").setCategory("General").setDisplayName("Foreground");
addProperty("columnNumber").setCategory("General").setDisplayName("Column Number");
addProperty("forceDrawOutline").setCategory("General").setDisplayName("Force Draw Outline");
addProperty("drawNeatLine").setCategory("Neat Line").setDisplayName("Draw Neat Line");
addProperty("neatLineColor").setCategory("Neat Line").setDisplayName("Neat Line Color");
addProperty("neatLineSize").setCategory("Neat Line").setDisplayName("Neat Line Size");
addProperty("drawChartBreaks").setCategory("Chart").setDisplayName("Draw Chart Breaks");
//addProperty("drawPieLabel").setCategory("Chart").setDisplayName("Draw Pie label");
addProperty("left").setCategory("Location").setDisplayName("Left");
addProperty("top").setCategory("Location").setDisplayName("Top");
addProperty("width").setCategory("Location").setDisplayName("Width");
addProperty("height").setCategory("Location").setDisplayName("Height");
//addProperty("barWidth").setCategory("ColorBar").setDisplayName("Bar Width");
}
示例6
public LayoutMapBeanBeanInfo() {
super(LayoutMapBean.class);
addProperty("drawBackColor").setCategory("General").setDisplayName("Draw Background");
addProperty("backColor").setCategory("General").setDisplayName("Background");
addProperty("foreColor").setCategory("General").setDisplayName("Foreground");
addProperty("drawNeatLine").setCategory("Neat Line").setDisplayName("Draw Neat Line");
addProperty("neatLineColor").setCategory("Neat Line").setDisplayName("Neat Line Color");
addProperty("neatLineSize").setCategory("Neat Line").setDisplayName("Neat Line Size");
addProperty("drawGridLine").setCategory("Grid Line").setDisplayName("Draw Grid Line");
addProperty("drawGridLabel").setCategory("Grid Line").setDisplayName("Draw Grid Label");
addProperty("gridXDelt").setCategory("Grid Line").setDisplayName("Grid X Interval");
addProperty("gridYDelt").setCategory("Grid Line").setDisplayName("Grid Y Interval");
addProperty("gridXOrigin").setCategory("Grid Line").setDisplayName("Grid X Origin");
addProperty("gridYOrigin").setCategory("Grid Line").setDisplayName("Grid Y Origin");
addProperty("gridFont").setCategory("Grid Line").setDisplayName("Grid Label Font");
addProperty("gridLabelShift").setCategory("Grid Line").setDisplayName("Grid Label Shift");
ExtendedPropertyDescriptor e = addProperty("gridLabelPosition");
e.setCategory("Grid Line").setDisplayName("Grid Label Position");
e.setPropertyEditorClass(GridLabelPositionEditor.class);
addProperty("drawDegreeSymbol").setCategory("Grid Line").setDisplayName("Draw Degree Symbol");
addProperty("gridLineColor").setCategory("Grid Line").setDisplayName("Grid Line Color");
addProperty("gridLineSize").setCategory("Grid Line").setDisplayName("Grid Line Size");
e = addProperty("gridLineStyle");
e.setCategory("Grid Line").setDisplayName("Grid Line Style");
e.setPropertyEditorClass(LineStyleEditor.class);
addProperty("insideTickLine").setCategory("Grid Line").setDisplayName("Inside Tick Line");
addProperty("tickLineLength").setCategory("Grid Line").setDisplayName("Tick Line Length");
addProperty("left").setCategory("Location").setDisplayName("Left");
addProperty("top").setCategory("Location").setDisplayName("Top");
addProperty("width").setCategory("Location").setDisplayName("Width");
addProperty("height").setCategory("Location").setDisplayName("Height");
}
示例7
public WebMapLayerBeanBeanInfo() {
super(WebMapLayer.WebMapLayerBean.class);
addProperty("layerType").setCategory("Read only").setReadOnly().setDisplayName("Layer type");
addProperty("layerDrawType").setCategory("Read only").setReadOnly().setDisplayName("Layer draw type");
addProperty("handle").setCategory("Read only").setReadOnly().setDisplayName("Handle");
ExtendedPropertyDescriptor e = addProperty("webMapProvider");
e.setCategory("Editable").setDisplayName("Web Map Provider");
e.setPropertyEditorClass(WebMapProviderEditor.class);
e = addProperty("language");
e.setCategory("Editable").setDisplayName("Language");
e.setPropertyEditorClass(LanguageEditor.class);
addProperty("visible").setCategory("Editable").setDisplayName("Visible");
addProperty("maskout").setCategory("Editable").setDisplayName("Is maskout");
}
示例8
public RasterLayerBeanBeanInfo() {
super(RasterLayer.RasterLayerBean.class);
addProperty("fileName").setCategory("Read only").setReadOnly().setDisplayName("File name");
addProperty("layerType").setCategory("Read only").setReadOnly().setDisplayName("Layer type");
addProperty("layerDrawType").setCategory("Read only").setReadOnly().setDisplayName("Layer draw type");
addProperty("handle").setCategory("Read only").setReadOnly().setDisplayName("Handle");
addProperty("layerName").setCategory("Editable").setDisplayName("Layer name");
addProperty("visible").setCategory("Editable").setDisplayName("Visible");
addProperty("maskout").setCategory("Editable").setDisplayName("Is maskout");
ExtendedPropertyDescriptor e = addProperty("interpolation");
e.setCategory("Editable").setPropertyEditorClass(InterpolationEditor.class);
e.setDisplayName("Interpolation");
}
示例9
/**
* Gets a renderer for the given property. The lookup is as follow:
* <ul>
* <li>if a renderer was registered with
* {@link ExtendedPropertyDescriptor#setPropertyTableRendererClass(Class)} - BeanInfo, it is
* returned, else</li>
* <li>if a renderer was registered with
* {@link #registerRenderer(Property, TableCellRenderer)}, it is
* returned, else</li>
* <li>if a renderer class was registered with
* {@link #registerRenderer(Property, Class)}, it is returned, else
* <li>
* <li>look for renderer for the property type using
* {@link #getRenderer(Class)}.</li>
* </ul>
*
* @param property
* @return a renderer suitable for the Property.
*/
public synchronized TableCellRenderer getRenderer(Property property)
{
// editors bound to the property descriptor have the highest priority
TableCellRenderer renderer = null;
if (property instanceof PropertyDescriptorAdapter) {
PropertyDescriptor descriptor = ((PropertyDescriptorAdapter) property).getDescriptor();
if (descriptor instanceof ExtendedPropertyDescriptor) {
if (((ExtendedPropertyDescriptor) descriptor).getPropertyTableRendererClass() != null) {
try {
return (TableCellRenderer) (((ExtendedPropertyDescriptor) descriptor).getPropertyTableRendererClass()).newInstance();
}
catch (Exception ex){
ex.printStackTrace();
}
}
}
}
Object value = propertyToRenderer.get(property);
if (value instanceof TableCellRenderer) {
renderer = (TableCellRenderer)value;
} else if (value instanceof Class) {
try {
renderer = (TableCellRenderer)((Class)value).newInstance();
} catch (Exception e) {
e.printStackTrace();
}
} else {
renderer = getRenderer(property.getType());
}
return renderer;
}
示例10
public String getCategory() {
if (descriptor instanceof ExtendedPropertyDescriptor) {
return ((ExtendedPropertyDescriptor)descriptor).getCategory();
} else {
return null;
}
}
示例11
/**
* Gets a renderer for the given property. The lookup is as follow:
* <ul>
* <li>if a renderer was registered with
* {@link ExtendedPropertyDescriptor#setPropertyTableRendererClass(Class)} - BeanInfo, it is
* returned, else</li>
* <li>if a renderer was registered with
* {@link #registerRenderer(Property, TableCellRenderer)}, it is
* returned, else</li>
* <li>if a renderer class was registered with
* {@link #registerRenderer(Property, Class)}, it is returned, else
* <li>
* <li>look for renderer for the property type using
* {@link #getRenderer(Class)}.</li>
* </ul>
*
* @param property
* @return a renderer suitable for the Property.
*/
public synchronized TableCellRenderer getRenderer(Property property)
{
// editors bound to the property descriptor have the highest priority
TableCellRenderer renderer = null;
if (property instanceof PropertyDescriptorAdapter) {
PropertyDescriptor descriptor = ((PropertyDescriptorAdapter) property).getDescriptor();
if (descriptor instanceof ExtendedPropertyDescriptor) {
if (((ExtendedPropertyDescriptor) descriptor).getPropertyTableRendererClass() != null) {
try {
return (TableCellRenderer) (((ExtendedPropertyDescriptor) descriptor).getPropertyTableRendererClass()).newInstance();
}
catch (Exception ex){
ex.printStackTrace();
}
}
}
}
Object value = propertyToRenderer.get(property);
if (value instanceof TableCellRenderer) {
renderer = (TableCellRenderer)value;
} else if (value instanceof Class) {
try {
renderer = (TableCellRenderer)((Class)value).newInstance();
} catch (Exception e) {
e.printStackTrace();
}
} else {
renderer = getRenderer(property.getType());
}
return renderer;
}
示例12
public String getCategory() {
if (descriptor instanceof ExtendedPropertyDescriptor) {
return ((ExtendedPropertyDescriptor)descriptor).getCategory();
} else {
return null;
}
}