Commit 4f07d5cd authored by claes's avatar claes

*** empty log message ***

parent a11b9e76
/*
* Proview $Id: JopArrow.java,v 1.3 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.beans;
import jpwr.rt.*;
import jpwr.jop.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.awt.font.*;
import javax.swing.*;
public class JopArrow extends JComponent {
Dimension size;
public JopArrow()
{
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
size = new Dimension( 24, 24);
}
int fillColor = 9999;
int originalFillColor = 9999;
int borderColor = 9999;
int colorTone = 0;
int originalColorTone = 0;
int colorShift = 0;
int originalColorShift = 0;
int colorBrightness = 0;
int originalColorBrightness = 0;
int colorIntensity = 0;
int originalColorIntensity = 0;
int colorInverse = 0;
int originalColorInverse = 0;
public void setColorTone( int colorTone) {
this.colorTone = colorTone;
originalColorTone = colorTone;
}
public int getColorTone() {
return colorTone;
}
public void setColorShift( int colorShift) {
this.colorShift = colorShift;
originalColorShift = colorShift;
}
public int getColorShift() {
return colorShift;
}
public void setColorBrightness( int colorBrightness) {
this.colorBrightness = colorBrightness;
originalColorBrightness = colorBrightness;
}
public int getColorBrightness() {
return colorBrightness;
}
public void setColorIntensity( int colorIntensity) {
this.colorIntensity = colorIntensity;
originalColorIntensity = colorIntensity;
}
public int getColorIntensity() {
return colorIntensity;
}
public void setFillColor( int fillColor) {
this.fillColor = fillColor;
this.originalFillColor = fillColor;
}
public void resetFillColor() {
fillColor = originalFillColor;
}
public int getFillColor() {
return fillColor;
}
public void setBorderColor( int borderColor) {
this.borderColor = borderColor;
}
public int getBorderColor() {
return borderColor;
}
int original_width = 24;
int original_height = 24;
double rotate;
public void setRotate( double rotate) {
if ( rotate < 0)
this.rotate = rotate % 360 + 360;
else
this.rotate = rotate % 360;
}
public double getRotate() { return rotate;}
Shape[] shapes = new Shape[] {
new Polygon( new int[] { 12, 2, 22, 12}, new int[] {2, 22, 22, 2}, 4),
};
public void paint(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
Component c;
Point p;
paintComponent(g);
for ( int i = 0; i < getComponentCount(); i++) {
AffineTransform save = g.getTransform();
c = getComponent(i);
p = c.getLocation();
g.translate((int)p.getX(), (int)p.getY());
c.paint(g);
g.setTransform(save);
}
}
public void paintComponent(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
g.setColor(GeColor.getColor(2, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false));
g.fill( shapes[0]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[0]);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
/*
* Proview $Id: JopArrowBeanInfo.java,v 1.2 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.beans;
import jpwr.jop.*;
import java.beans.*;
public class JopArrowBeanInfo extends SimpleBeanInfo {
Class beanClass = JopArrow.class;
String iconColor16x16Filename = "joparrow16.gif";
String iconColor32x32Filename = "joparrow32.gif";
String iconMono16x16Filename;
String iconMono32x32Filename;
public JopArrowBeanInfo() {
}
public PropertyDescriptor[] getPropertyDescriptors() {
try {
PropertyDescriptor _toolTipText = new PropertyDescriptor("toolTipText",
beanClass, "getToolTipText", "setToolTipText");
_toolTipText.setDisplayName("toolTipText");
_toolTipText.setShortDescription("toolTipText");
PropertyDescriptor _fillColor = new PropertyDescriptor("fillColor",
beanClass, "getFillColor", "setFillColor");
_fillColor.setDisplayName("fillColor");
_fillColor.setShortDescription("fillColor");
_fillColor.setPropertyEditorClass(GeColorEditor.class);
PropertyDescriptor _borderColor = new PropertyDescriptor("borderColor",
beanClass, "getBorderColor", "setBorderColor");
_borderColor.setDisplayName("borderColor");
_borderColor.setShortDescription("borderColor");
_borderColor.setPropertyEditorClass(GeColorEditor.class);
PropertyDescriptor _colorTone = new PropertyDescriptor("colorTone",
beanClass, "getColorTone", "setColorTone");
_colorTone.setDisplayName("colorTone");
_colorTone.setShortDescription("colorTone");
_colorTone.setPropertyEditorClass(GeColorToneEditor.class);
PropertyDescriptor _colorShift = new PropertyDescriptor("colorShift",
beanClass, "getColorShift", "setColorShift");
_colorShift.setDisplayName("colorShift");
_colorShift.setShortDescription("colorShift");
_colorShift.setPropertyEditorClass(GeColorShiftEditor.class);
PropertyDescriptor _colorBrightness = new PropertyDescriptor("colorBrightness",
beanClass, "getColorBrightness", "setColorBrightness");
_colorBrightness.setDisplayName("colorBrightness");
_colorBrightness.setShortDescription("colorBrightness");
_colorBrightness.setPropertyEditorClass(GeColorBrightnessEditor.class);
PropertyDescriptor _colorIntensity = new PropertyDescriptor("colorIntensity",
beanClass, "getColorIntensity", "setColorIntensity");
_colorIntensity.setDisplayName("colorIntensity");
_colorIntensity.setShortDescription("colorIntensity");
_colorIntensity.setPropertyEditorClass(GeColorIntensityEditor.class);
PropertyDescriptor _rotate = new PropertyDescriptor("rotate",
beanClass, "getRotate", "setRotate");
_rotate.setDisplayName("rotate");
_rotate.setShortDescription("rotate");
PropertyDescriptor[] pds = new PropertyDescriptor[] {
_toolTipText, _fillColor, _borderColor, _colorTone, _colorShift,
_colorBrightness, _colorIntensity, _rotate};
return pds;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
public java.awt.Image getIcon(int iconKind) {
switch (iconKind) {
case BeanInfo.ICON_COLOR_16x16:
return iconColor16x16Filename != null ? loadImage(iconColor16x16Filename) : null;
case BeanInfo.ICON_COLOR_32x32:
return iconColor32x32Filename != null ? loadImage(iconColor32x32Filename) : null;
case BeanInfo.ICON_MONO_16x16:
return iconMono16x16Filename != null ? loadImage(iconMono16x16Filename) : null;
case BeanInfo.ICON_MONO_32x32:
return iconMono32x32Filename != null ? loadImage(iconMono32x32Filename) : null;
}
return null;
}
public BeanInfo[] getAdditionalBeanInfo() {
Class superclass = beanClass.getSuperclass();
try {
BeanInfo superBeanInfo = Introspector.getBeanInfo(superclass);
// return new BeanInfo[] { superBeanInfo };
return null;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
}
This diff is collapsed.
This diff is collapsed.
/*
* Proview $Id: JopButtonimageBeanInfo.java,v 1.2 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.beans;
import jpwr.jop.*;
import java.beans.*;
public class JopButtonimageBeanInfo extends SimpleBeanInfo {
Class beanClass = JopButtonimage.class;
String iconColor16x16Filename = "jopbuttonimage16.gif";
String iconColor32x32Filename = "jopbuttonimage32.gif";
String iconMono16x16Filename;
String iconMono32x32Filename;
public JopButtonimageBeanInfo() {
}
public PropertyDescriptor[] getPropertyDescriptors() {
try {
PropertyDescriptor _image = new PropertyDescriptor("image",
beanClass, "getImage", "setImage");
_image.setDisplayName("image");
_image.setShortDescription("image");
PropertyDescriptor _imageLow = new PropertyDescriptor("imageLow",
beanClass, "getImageLow", "setImageLow");
_imageLow.setDisplayName("imageLow");
_imageLow.setShortDescription("imageLow");
PropertyDescriptor _imagePress = new PropertyDescriptor("imagePress",
beanClass, "getImagePress", "setImagePress");
_imagePress.setDisplayName("imagePress");
_imagePress.setShortDescription("imagePress");
PropertyDescriptor _pwrAttribute = new PropertyDescriptor("pwrAttribute",
beanClass, "getPwrAttribute", "setPwrAttribute");
_pwrAttribute.setDisplayName("pwrAttribute");
_pwrAttribute.setShortDescription("pwrAttribute");
PropertyDescriptor _pwrAttrImage = new PropertyDescriptor("pwrAttrImage",
beanClass, "getPwrAttrImage", "setPwrAttrImage");
_pwrAttrImage.setDisplayName("pwrAttrImage");
_pwrAttrImage.setShortDescription("pwrAttrImage");
PropertyDescriptor _clickAction = new PropertyDescriptor("clickAction",
beanClass, "getClickAction", "setClickAction");
_clickAction.setDisplayName("clickAction");
_clickAction.setShortDescription("clickAction");
_clickAction.setPropertyEditorClass(ClickActionEditor.class);
PropertyDescriptor _command = new PropertyDescriptor("command",
beanClass, "getCommand", "setCommand");
_command.setDisplayName("command");
_command.setShortDescription("command");
PropertyDescriptor _confirm = new PropertyDescriptor("confirm",
beanClass, "getConfirm", "setConfirm");
_confirm.setDisplayName("confirm");
_confirm.setShortDescription("confirm");
PropertyDescriptor _confirmText = new PropertyDescriptor("confirmText",
beanClass, "getConfirmText", "setConfirmText");
_confirmText.setDisplayName("confirmText");
_confirmText.setShortDescription("confirmText");
PropertyDescriptor[] pds = new PropertyDescriptor[] {
_image, _imageLow, _imagePress, _pwrAttribute, _pwrAttrImage,
_clickAction, _command, _confirm, _confirmText};
return pds;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
public java.awt.Image getIcon(int iconKind) {
switch (iconKind) {
case BeanInfo.ICON_COLOR_16x16:
return iconColor16x16Filename != null ? loadImage(iconColor16x16Filename) : null;
case BeanInfo.ICON_COLOR_32x32:
return iconColor32x32Filename != null ? loadImage(iconColor32x32Filename) : null;
case BeanInfo.ICON_MONO_16x16:
return iconMono16x16Filename != null ? loadImage(iconMono16x16Filename) : null;
case BeanInfo.ICON_MONO_32x32:
return iconMono32x32Filename != null ? loadImage(iconMono32x32Filename) : null;
}
return null;
}
public BeanInfo[] getAdditionalBeanInfo() {
Class superclass = beanClass.getSuperclass();
try {
BeanInfo superBeanInfo = Introspector.getBeanInfo(superclass);
// return new BeanInfo[] { superBeanInfo };
return null;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
}
This diff is collapsed.
/*
* Proview $Id: JopButtonsetBeanInfo.java,v 1.2 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.beans;
import jpwr.jop.*;
import java.beans.*;
public class JopButtonsetBeanInfo extends SimpleBeanInfo {
Class beanClass = JopButtonset.class;
String iconColor16x16Filename = "jopbuttonset16.gif";
String iconColor32x32Filename = "jopbuttonset32.gif";
String iconMono16x16Filename;
String iconMono32x32Filename;
public JopButtonsetBeanInfo() {
}
public PropertyDescriptor[] getPropertyDescriptors() {
try {
PropertyDescriptor _toolTipText = new PropertyDescriptor("toolTipText",
beanClass, "getToolTipText", "setToolTipText");
_toolTipText.setDisplayName("toolTipText");
_toolTipText.setShortDescription("toolTipText");
PropertyDescriptor _fillColor = new PropertyDescriptor("fillColor",
beanClass, "getFillColor", "setFillColor");
_fillColor.setDisplayName("fillColor");
_fillColor.setShortDescription("fillColor");
_fillColor.setPropertyEditorClass(GeColorEditor.class);
PropertyDescriptor _borderColor = new PropertyDescriptor("borderColor",
beanClass, "getBorderColor", "setBorderColor");
_borderColor.setDisplayName("borderColor");
_borderColor.setShortDescription("borderColor");
_borderColor.setPropertyEditorClass(GeColorEditor.class);
PropertyDescriptor _colorTone = new PropertyDescriptor("colorTone",
beanClass, "getColorTone", "setColorTone");
_colorTone.setDisplayName("colorTone");
_colorTone.setShortDescription("colorTone");
_colorTone.setPropertyEditorClass(GeColorToneEditor.class);
PropertyDescriptor _colorShift = new PropertyDescriptor("colorShift",
beanClass, "getColorShift", "setColorShift");
_colorShift.setDisplayName("colorShift");
_colorShift.setShortDescription("colorShift");
_colorShift.setPropertyEditorClass(GeColorShiftEditor.class);
PropertyDescriptor _colorBrightness = new PropertyDescriptor("colorBrightness",
beanClass, "getColorBrightness", "setColorBrightness");
_colorBrightness.setDisplayName("colorBrightness");
_colorBrightness.setShortDescription("colorBrightness");
_colorBrightness.setPropertyEditorClass(GeColorBrightnessEditor.class);
PropertyDescriptor _colorIntensity = new PropertyDescriptor("colorIntensity",
beanClass, "getColorIntensity", "setColorIntensity");
_colorIntensity.setDisplayName("colorIntensity");
_colorIntensity.setShortDescription("colorIntensity");
_colorIntensity.setPropertyEditorClass(GeColorIntensityEditor.class);
PropertyDescriptor _rotate = new PropertyDescriptor("rotate",
beanClass, "getRotate", "setRotate");
_rotate.setDisplayName("rotate");
_rotate.setShortDescription("rotate");
PropertyDescriptor _clickAction = new PropertyDescriptor("clickAction",
beanClass, "getClickAction", "setClickAction");
_clickAction.setDisplayName("clickAction");
_clickAction.setShortDescription("clickAction");
_clickAction.setPropertyEditorClass(ClickActionEditor.class);
PropertyDescriptor _command = new PropertyDescriptor("command",
beanClass, "getCommand", "setCommand");
_command.setDisplayName("command");
_command.setShortDescription("command");
PropertyDescriptor _lowTone = new PropertyDescriptor("lowTone",
beanClass, "getLowTone", "setLowTone");
_lowTone.setDisplayName("lowTone");
_lowTone.setShortDescription("lowTone");
_lowTone.setPropertyEditorClass(GeColorToneEditor.class);
PropertyDescriptor _pwrAttribute = new PropertyDescriptor("pwrAttribute",
beanClass, "getPwrAttribute", "setPwrAttribute");
_pwrAttribute.setDisplayName("pwrAttribute");
_pwrAttribute.setShortDescription("pwrAttribute");
PropertyDescriptor _pwrAttrColor = new PropertyDescriptor("pwrAttrColor",
beanClass, "getPwrAttrColor", "setPwrAttrColor");
_pwrAttrColor.setDisplayName("pwrAttrColor");
_pwrAttrColor.setShortDescription("pwrAttColor");
PropertyDescriptor _pwrAttrText = new PropertyDescriptor("pwrAttrText",
beanClass, "getPwrAttrText", "setPwrAttrText");
_pwrAttrText.setDisplayName("pwrAttrText");
_pwrAttrText.setShortDescription("pwrAttText");
PropertyDescriptor _textLow = new PropertyDescriptor("textLow",
beanClass, "getTextLow", "setTextLow");
_textLow.setDisplayName("textLow");
_textLow.setShortDescription("textLow");
PropertyDescriptor _textHigh = new PropertyDescriptor("textHigh",
beanClass, "getTextHigh", "setTextHigh");
_textHigh.setDisplayName("textHigh");
_textHigh.setShortDescription("textHigh");
PropertyDescriptor _access = new PropertyDescriptor("access",
beanClass, "getAccess", "setAccess");
_access.setDisplayName("access");
_access.setShortDescription("access");
PropertyDescriptor _confirm = new PropertyDescriptor("confirm",
beanClass, "getConfirm", "setConfirm");
_confirm.setDisplayName("confirm");
_confirm.setShortDescription("confirm");
PropertyDescriptor _confirmText = new PropertyDescriptor("confirmText",
beanClass, "getConfirmText", "setConfirmText");
_confirmText.setDisplayName("confirmText");
_confirmText.setShortDescription("confirmText");
PropertyDescriptor _annot1 = new PropertyDescriptor("annot1",
beanClass, "getAnnot1", "setAnnot1");
_annot1.setDisplayName("annot1");
_annot1.setShortDescription("annot1");
PropertyDescriptor _annot1Font = new PropertyDescriptor("annot1Font",
beanClass, "getAnnot1Font", "setAnnot1Font");
_annot1Font.setDisplayName("annot1Font");
_annot1Font.setShortDescription("annot1Font");
PropertyDescriptor[] pds = new PropertyDescriptor[] {
_toolTipText, _fillColor, _borderColor, _colorTone, _colorShift,
_colorBrightness, _colorIntensity, _rotate,
_clickAction, _command, _lowTone, _pwrAttribute, _pwrAttrColor,
_pwrAttrText, _textLow, _textHigh, _access, _confirm, _confirmText, _annot1, _annot1Font};
return pds;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
public java.awt.Image getIcon(int iconKind) {
switch (iconKind) {
case BeanInfo.ICON_COLOR_16x16:
return iconColor16x16Filename != null ? loadImage(iconColor16x16Filename) : null;
case BeanInfo.ICON_COLOR_32x32:
return iconColor32x32Filename != null ? loadImage(iconColor32x32Filename) : null;
case BeanInfo.ICON_MONO_16x16:
return iconMono16x16Filename != null ? loadImage(iconMono16x16Filename) : null;
case BeanInfo.ICON_MONO_32x32:
return iconMono32x32Filename != null ? loadImage(iconMono32x32Filename) : null;
}
return null;
}
public BeanInfo[] getAdditionalBeanInfo() {
Class superclass = beanClass.getSuperclass();
try {
BeanInfo superBeanInfo = Introspector.getBeanInfo(superclass);
// return new BeanInfo[] { superBeanInfo };
return null;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
}
This diff is collapsed.
/*
* Proview $Id: JopButtontoggleBeanInfo.java,v 1.2 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.beans;
import jpwr.jop.*;
import java.beans.*;
public class JopButtontoggleBeanInfo extends SimpleBeanInfo {
Class beanClass = JopButtontoggle.class;
String iconColor16x16Filename;
String iconColor32x32Filename;
String iconMono16x16Filename;
String iconMono32x32Filename;
public JopButtontoggleBeanInfo() {
}
public PropertyDescriptor[] getPropertyDescriptors() {
try {
PropertyDescriptor _fillColor = new PropertyDescriptor("fillColor",
beanClass, "getFillColor", "setFillColor");
_fillColor.setDisplayName("fillColor");
_fillColor.setShortDescription("fillColor");
_fillColor.setPropertyEditorClass(GeColorEditor.class);
PropertyDescriptor _borderColor = new PropertyDescriptor("borderColor",
beanClass, "getBorderColor", "setBorderColor");
_borderColor.setDisplayName("borderColor");
_borderColor.setShortDescription("borderColor");
_borderColor.setPropertyEditorClass(GeColorEditor.class);
PropertyDescriptor _colorTone = new PropertyDescriptor("colorTone",
beanClass, "getColorTone", "setColorTone");
_colorTone.setDisplayName("colorTone");
_colorTone.setShortDescription("colorTone");
_colorTone.setPropertyEditorClass(GeColorToneEditor.class);
PropertyDescriptor _colorShift = new PropertyDescriptor("colorShift",
beanClass, "getColorShift", "setColorShift");
_colorShift.setDisplayName("colorShift");
_colorShift.setShortDescription("colorShift");
_colorShift.setPropertyEditorClass(GeColorShiftEditor.class);
PropertyDescriptor _colorBrightness = new PropertyDescriptor("colorBrightness",
beanClass, "getColorBrightness", "setColorBrightness");
_colorBrightness.setDisplayName("colorBrightness");
_colorBrightness.setShortDescription("colorBrightness");
_colorBrightness.setPropertyEditorClass(GeColorBrightnessEditor.class);
PropertyDescriptor _colorIntensity = new PropertyDescriptor("colorIntensity",
beanClass, "getColorIntensity", "setColorIntensity");
_colorIntensity.setDisplayName("colorIntensity");
_colorIntensity.setShortDescription("colorIntensity");
_colorIntensity.setPropertyEditorClass(GeColorIntensityEditor.class);
PropertyDescriptor _clickAction = new PropertyDescriptor("clickAction",
beanClass, "getClickAction", "setClickAction");
_clickAction.setDisplayName("clickAction");
_clickAction.setShortDescription("clickAction");
_clickAction.setPropertyEditorClass(ClickActionEditor.class);
PropertyDescriptor _lowColor = new PropertyDescriptor("lowColor",
beanClass, "getLowColor", "setLowColor");
_lowColor.setDisplayName("lowColor");
_lowColor.setShortDescription("lowColor");
_lowColor.setPropertyEditorClass(GeColorEditor.class);
PropertyDescriptor[] pds = new PropertyDescriptor[] {
_fillColor, _borderColor, _colorTone, _colorShift,
_colorBrightness, _colorIntensity,
_clickAction, _lowColor};
return pds;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
public java.awt.Image getIcon(int iconKind) {
switch (iconKind) {
case BeanInfo.ICON_COLOR_16x16:
return iconColor16x16Filename != null ? loadImage(iconColor16x16Filename) : null;
case BeanInfo.ICON_COLOR_32x32:
return iconColor32x32Filename != null ? loadImage(iconColor32x32Filename) : null;
case BeanInfo.ICON_MONO_16x16:
return iconMono16x16Filename != null ? loadImage(iconMono16x16Filename) : null;
case BeanInfo.ICON_MONO_32x32:
return iconMono32x32Filename != null ? loadImage(iconMono32x32Filename) : null;
}
return null;
}
public BeanInfo[] getAdditionalBeanInfo() {
Class superclass = beanClass.getSuperclass();
try {
BeanInfo superBeanInfo = Introspector.getBeanInfo(superclass);
return new BeanInfo[] { superBeanInfo };
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
}
/*
* Proview $Id: JopCheckvalve.java,v 1.3 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.beans;
import jpwr.rt.*;
import jpwr.jop.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.awt.font.*;
import javax.swing.*;
public class JopCheckvalve extends JComponent {
Dimension size;
public JopCheckvalve()
{
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
size = new Dimension( 28, 17);
}
int fillColor = 9999;
int originalFillColor = 9999;
int borderColor = 9999;
int colorTone = 0;
int originalColorTone = 0;
int colorShift = 0;
int originalColorShift = 0;
int colorBrightness = 0;
int originalColorBrightness = 0;
int colorIntensity = 0;
int originalColorIntensity = 0;
int colorInverse = 0;
int originalColorInverse = 0;
public void setColorTone( int colorTone) {
this.colorTone = colorTone;
originalColorTone = colorTone;
}
public int getColorTone() {
return colorTone;
}
public void setColorShift( int colorShift) {
this.colorShift = colorShift;
originalColorShift = colorShift;
}
public int getColorShift() {
return colorShift;
}
public void setColorBrightness( int colorBrightness) {
this.colorBrightness = colorBrightness;
originalColorBrightness = colorBrightness;
}
public int getColorBrightness() {
return colorBrightness;
}
public void setColorIntensity( int colorIntensity) {
this.colorIntensity = colorIntensity;
originalColorIntensity = colorIntensity;
}
public int getColorIntensity() {
return colorIntensity;
}
public void setFillColor( int fillColor) {
this.fillColor = fillColor;
this.originalFillColor = fillColor;
}
public void resetFillColor() {
fillColor = originalFillColor;
}
public int getFillColor() {
return fillColor;
}
public void setBorderColor( int borderColor) {
this.borderColor = borderColor;
}
public int getBorderColor() {
return borderColor;
}
int original_width = 28;
int original_height = 17;
double rotate;
public void setRotate( double rotate) {
if ( rotate < 0)
this.rotate = rotate % 360 + 360;
else
this.rotate = rotate % 360;
}
public double getRotate() { return rotate;}
Shape[] shapes = new Shape[] {
new Arc2D.Float(8.30646F, 3.97174F, 12F, 12F, 0F, 360F, Arc2D.OPEN),
new Line2D.Float( 2F, 12.1914F, 14.3559F, 2F),
new Line2D.Float( 26.1707F, 12.4619F, 14.3559F, 2F),
};
public void paint(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
Component c;
Point p;
paintComponent(g);
for ( int i = 0; i < getComponentCount(); i++) {
AffineTransform save = g.getTransform();
c = getComponent(i);
p = c.getLocation();
g.translate((int)p.getX(), (int)p.getY());
c.paint(g);
g.setTransform(save);
}
}
public void paintComponent(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
g.setStroke( new BasicStroke(2F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[0]);
g.setStroke( new BasicStroke(2F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[1]);
g.setStroke( new BasicStroke(2F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[2]);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
/*
* Proview $Id: JopCheckvalveBeanInfo.java,v 1.2 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.beans;
import jpwr.jop.*;
import java.beans.*;
public class JopCheckvalveBeanInfo extends SimpleBeanInfo {
Class beanClass = JopCheckvalve.class;
String iconColor16x16Filename = "jopcheckvalve16.gif";
String iconColor32x32Filename = "jopcheckvalve32.gif";
String iconMono16x16Filename;
String iconMono32x32Filename;
public JopCheckvalveBeanInfo() {
}
public PropertyDescriptor[] getPropertyDescriptors() {
try {
PropertyDescriptor _toolTipText = new PropertyDescriptor("toolTipText",
beanClass, "getToolTipText", "setToolTipText");
_toolTipText.setDisplayName("toolTipText");
_toolTipText.setShortDescription("toolTipText");
PropertyDescriptor _fillColor = new PropertyDescriptor("fillColor",
beanClass, "getFillColor", "setFillColor");
_fillColor.setDisplayName("fillColor");
_fillColor.setShortDescription("fillColor");
_fillColor.setPropertyEditorClass(GeColorEditor.class);
PropertyDescriptor _borderColor = new PropertyDescriptor("borderColor",
beanClass, "getBorderColor", "setBorderColor");
_borderColor.setDisplayName("borderColor");
_borderColor.setShortDescription("borderColor");
_borderColor.setPropertyEditorClass(GeColorEditor.class);
PropertyDescriptor _colorTone = new PropertyDescriptor("colorTone",
beanClass, "getColorTone", "setColorTone");
_colorTone.setDisplayName("colorTone");
_colorTone.setShortDescription("colorTone");
_colorTone.setPropertyEditorClass(GeColorToneEditor.class);
PropertyDescriptor _colorShift = new PropertyDescriptor("colorShift",
beanClass, "getColorShift", "setColorShift");
_colorShift.setDisplayName("colorShift");
_colorShift.setShortDescription("colorShift");
_colorShift.setPropertyEditorClass(GeColorShiftEditor.class);
PropertyDescriptor _colorBrightness = new PropertyDescriptor("colorBrightness",
beanClass, "getColorBrightness", "setColorBrightness");
_colorBrightness.setDisplayName("colorBrightness");
_colorBrightness.setShortDescription("colorBrightness");
_colorBrightness.setPropertyEditorClass(GeColorBrightnessEditor.class);
PropertyDescriptor _colorIntensity = new PropertyDescriptor("colorIntensity",
beanClass, "getColorIntensity", "setColorIntensity");
_colorIntensity.setDisplayName("colorIntensity");
_colorIntensity.setShortDescription("colorIntensity");
_colorIntensity.setPropertyEditorClass(GeColorIntensityEditor.class);
PropertyDescriptor _rotate = new PropertyDescriptor("rotate",
beanClass, "getRotate", "setRotate");
_rotate.setDisplayName("rotate");
_rotate.setShortDescription("rotate");
PropertyDescriptor[] pds = new PropertyDescriptor[] {
_toolTipText, _fillColor, _borderColor, _colorTone, _colorShift,
_colorBrightness, _colorIntensity, _rotate};
return pds;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
public java.awt.Image getIcon(int iconKind) {
switch (iconKind) {
case BeanInfo.ICON_COLOR_16x16:
return iconColor16x16Filename != null ? loadImage(iconColor16x16Filename) : null;
case BeanInfo.ICON_COLOR_32x32:
return iconColor32x32Filename != null ? loadImage(iconColor32x32Filename) : null;
case BeanInfo.ICON_MONO_16x16:
return iconMono16x16Filename != null ? loadImage(iconMono16x16Filename) : null;
case BeanInfo.ICON_MONO_32x32:
return iconMono32x32Filename != null ? loadImage(iconMono32x32Filename) : null;
}
return null;
}
public BeanInfo[] getAdditionalBeanInfo() {
Class superclass = beanClass.getSuperclass();
try {
BeanInfo superBeanInfo = Introspector.getBeanInfo(superclass);
// return new BeanInfo[] { superBeanInfo };
return null;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
}
/*
* Proview $Id: JopCon.java,v 1.2 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.beans;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.awt.font.*;
import javax.swing.*;
import jpwr.jop.*;
public class JopCon extends JComponent {
Dimension size;
public JopCon()
{
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
size = new Dimension( 60, 30);
}
int borderColor = 9999;
int lineWidth = 1;
public void setBorderColor( int borderColor) {
this.borderColor = borderColor;
}
public int getBorderColor() {
return borderColor;
}
public void setLineWidth( int lineWidth) {
this.lineWidth = lineWidth;
}
public int getLineWidth() {
return lineWidth;
}
int original_width = 60;
int original_height = 30;
public double rotate;
public void setRotate( double rotate) { this.rotate = rotate;}
public double getRotate() { return rotate;}
Shape[] shapes = new Shape[] { null, null, null,};
float widthOld = 0;
float heightOld = 0;
double rotateOld = 0;
public void paint(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
Component c;
Point p;
paintComponent(g);
for ( int i = 0; i < getComponentCount(); i++) {
AffineTransform save = g.getTransform();
c = getComponent(i);
p = c.getLocation();
g.translate((int)p.getX(), (int)p.getY());
c.paint(g);
g.setTransform(save);
}
}
public void paintComponent(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
float width = getWidth();
float height = getHeight();
if ( shapes[0] == null) {
shapes[0] = new Line2D.Float();
shapes[1] = new Line2D.Float();
shapes[2] = new Line2D.Float();
}
if ( width != widthOld || height != heightOld || rotate != rotateOld) {
if ( 45.0 <= rotate && rotate < 135.0) {
if ( width < 20) {
((Line2D.Float)shapes[0]).setLine(width/2, 0F, width/2, height);
((Line2D.Float)shapes[1]).setLine(width/2, 0F, width/2, 0F);
((Line2D.Float)shapes[2]).setLine(width/2, 0F, width/2, 0F);
}
else {
((Line2D.Float)shapes[0]).setLine(10F, 0F, 10F, height/2);
((Line2D.Float)shapes[1]).setLine(10F, height/2, width - 10F, height/2);
((Line2D.Float)shapes[2]).setLine(width - 10F, height/2, width - 10F, height);
}
}
else if ( 135.0 <= rotate && rotate < 225.0) {
if ( height < 20) {
((Line2D.Float)shapes[0]).setLine(0F, height/2, width, height/2);
((Line2D.Float)shapes[1]).setLine(0F, height/2, 0F, height/2);
((Line2D.Float)shapes[2]).setLine(0F, height/2, 0F, height/2);
}
else {
((Line2D.Float)shapes[0]).setLine(0F, 10F, width/2, 10F);
((Line2D.Float)shapes[1]).setLine(width/2, 10F, width/2, height - 10F);
((Line2D.Float)shapes[2]).setLine(width/2, height - 10F, width, height - 10F);
}
}
else if ( 225.0 <= rotate && rotate < 315.0) {
if ( width < 20) {
((Line2D.Float)shapes[0]).setLine(width/2, 0F, width/2, height);
((Line2D.Float)shapes[1]).setLine(width/2, 0F, width/2, 0F);
((Line2D.Float)shapes[2]).setLine(width/2, 0F, width/2, 0F);
}
else {
((Line2D.Float)shapes[0]).setLine(10F, 0F, 10F, height/2);
((Line2D.Float)shapes[1]).setLine(width - 10F, height/2, 10F, height/2);
((Line2D.Float)shapes[2]).setLine(width - 10F, height/2, width - 10F, height);
}
}
else {
if ( height < 20) {
((Line2D.Float)shapes[0]).setLine(0F, height/2, width, height/2);
((Line2D.Float)shapes[1]).setLine(0F, height/2, 0F, height/2);
((Line2D.Float)shapes[2]).setLine(0F, height/2, 0F, height/2);
}
else {
((Line2D.Float)shapes[0]).setLine(0F, height - 10F, width/2, height - 10F);
((Line2D.Float)shapes[1]).setLine(width/2, height - 10F, width/2, 10F);
((Line2D.Float)shapes[2]).setLine(width/2, 10F, width, 10F);
}
}
widthOld = width;
heightOld = height;
rotateOld = rotate;
}
g.setStroke( new BasicStroke((float)lineWidth));
g.setColor(GeColor.getColor(0, borderColor));
g.draw( shapes[0]);
g.draw( shapes[1]);
g.draw( shapes[2]);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
/*
* Proview $Id: JopConBeanInfo.java,v 1.2 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.beans;
import jpwr.jop.*;
import java.beans.*;
public class JopConBeanInfo extends SimpleBeanInfo {
Class beanClass = JopCon.class;
String iconColor16x16Filename = "jopcon16.gif";
String iconColor32x32Filename = "jopcon32.gif";
String iconMono16x16Filename;
String iconMono32x32Filename;
public JopConBeanInfo() {
}
public PropertyDescriptor[] getPropertyDescriptors() {
try {
PropertyDescriptor _borderColor = new PropertyDescriptor("borderColor",
beanClass, "getBorderColor", "setBorderColor");
_borderColor.setDisplayName("borderColor");
_borderColor.setShortDescription("borderColor");
_borderColor.setPropertyEditorClass(GeColorEditor.class);
PropertyDescriptor _lineWidth = new PropertyDescriptor("lineWidth",
beanClass, "getLineWidth", "setLineWidth");
_lineWidth.setDisplayName("lineWidth");
_lineWidth.setShortDescription("lineWidth");
PropertyDescriptor _rotate = new PropertyDescriptor("rotate",
beanClass, "getRotate", "setRotate");
_rotate.setDisplayName("rotate");
_rotate.setShortDescription("rotate");
PropertyDescriptor[] pds = new PropertyDescriptor[] {
_borderColor, _lineWidth, _rotate};
return pds;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
public java.awt.Image getIcon(int iconKind) {
switch (iconKind) {
case BeanInfo.ICON_COLOR_16x16:
return iconColor16x16Filename != null ? loadImage(iconColor16x16Filename) : null;
case BeanInfo.ICON_COLOR_32x32:
return iconColor32x32Filename != null ? loadImage(iconColor32x32Filename) : null;
case BeanInfo.ICON_MONO_16x16:
return iconMono16x16Filename != null ? loadImage(iconMono16x16Filename) : null;
case BeanInfo.ICON_MONO_32x32:
return iconMono32x32Filename != null ? loadImage(iconMono32x32Filename) : null;
}
return null;
}
public BeanInfo[] getAdditionalBeanInfo() {
Class superclass = beanClass.getSuperclass();
try {
BeanInfo superBeanInfo = Introspector.getBeanInfo(superclass);
// return new BeanInfo[] { superBeanInfo };
return null;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
}
/*
* Proview $Id: JopCon_u.java,v 1.2 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.beans;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.awt.font.*;
import javax.swing.*;
import jpwr.jop.*;
public class JopCon_u extends JComponent {
Dimension size;
public JopCon_u()
{
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
size = new Dimension( 40, 40);
}
int borderColor = 9999;
int lineWidth = 1;
public void setBorderColor( int borderColor) {
this.borderColor = borderColor;
}
public int getBorderColor() {
return borderColor;
}
public void setLineWidth( int lineWidth) {
this.lineWidth = lineWidth;
}
public int getLineWidth() {
return lineWidth;
}
int original_width = 40;
int original_height = 40;
public double rotate;
public void setRotate( double rotate) { this.rotate = rotate;}
public double getRotate() { return rotate;}
Shape[] shapes = new Shape[] { null, null, null,};
float widthOld = 0;
float heightOld = 0;
double rotateOld = 0;
public void paint(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
Component c;
Point p;
paintComponent(g);
for ( int i = 0; i < getComponentCount(); i++) {
AffineTransform save = g.getTransform();
c = getComponent(i);
p = c.getLocation();
g.translate((int)p.getX(), (int)p.getY());
c.paint(g);
g.setTransform(save);
}
}
public void paintComponent(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
float width = getWidth();
float height = getHeight();
if ( shapes[0] == null) {
shapes[0] = new Line2D.Float();
shapes[1] = new Line2D.Float();
shapes[2] = new Line2D.Float();
}
if ( width != widthOld || height != heightOld || rotate != rotateOld) {
if ( 45.0 <= rotate && rotate < 135.0) {
((Line2D.Float)shapes[0]).setLine(10F, 10F, 10F, height);
((Line2D.Float)shapes[1]).setLine(10F, 10F, width - 10F, 10F);
((Line2D.Float)shapes[2]).setLine(width - 10F, 10F, width - 10F, height);
}
else if ( 135.0 <= rotate && rotate < 225.0) {
((Line2D.Float)shapes[0]).setLine(10F, height - 10F, width, height - 10F);
((Line2D.Float)shapes[1]).setLine(10F, height - 10F, 10F, 10F);
((Line2D.Float)shapes[2]).setLine(10F, 10F, width, 10F);
}
else if ( 225.0 <= rotate && rotate < 315.0) {
((Line2D.Float)shapes[0]).setLine(10F, 0F, 10F, height - 10F);
((Line2D.Float)shapes[1]).setLine(10F, height - 10F, width - 10F, height - 10F);
((Line2D.Float)shapes[2]).setLine(width - 10F, height - 10F, width - 10F, 0F);
}
else {
((Line2D.Float)shapes[0]).setLine(0F, height - 10F, width - 10F, height - 10F);
((Line2D.Float)shapes[1]).setLine(width - 10F, height - 10F, width - 10F, 10F);
((Line2D.Float)shapes[2]).setLine(width - 10F, 10F, 0F, 10F);
}
widthOld = width;
heightOld = height;
rotateOld = rotate;
}
g.setStroke( new BasicStroke((float)lineWidth));
g.setColor(GeColor.getColor(0, borderColor));
g.draw( shapes[0]);
g.draw( shapes[1]);
g.draw( shapes[2]);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
/*
* Proview $Id: JopCon_uBeanInfo.java,v 1.2 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.beans;
import jpwr.jop.*;
import java.beans.*;
public class JopCon_uBeanInfo extends SimpleBeanInfo {
Class beanClass = JopCon_u.class;
String iconColor16x16Filename = "jopcon_u16.gif";
String iconColor32x32Filename = "jopcon_u32.gif";
String iconMono16x16Filename;
String iconMono32x32Filename;
public JopCon_uBeanInfo() {
}
public PropertyDescriptor[] getPropertyDescriptors() {
try {
PropertyDescriptor _borderColor = new PropertyDescriptor("borderColor",
beanClass, "getBorderColor", "setBorderColor");
_borderColor.setDisplayName("borderColor");
_borderColor.setShortDescription("borderColor");
_borderColor.setPropertyEditorClass(GeColorEditor.class);
PropertyDescriptor _lineWidth = new PropertyDescriptor("lineWidth",
beanClass, "getLineWidth", "setLineWidth");
_lineWidth.setDisplayName("lineWidth");
_lineWidth.setShortDescription("lineWidth");
PropertyDescriptor _rotate = new PropertyDescriptor("rotate",
beanClass, "getRotate", "setRotate");
_rotate.setDisplayName("rotate");
_rotate.setShortDescription("rotate");
PropertyDescriptor[] pds = new PropertyDescriptor[] {
_borderColor, _lineWidth, _rotate};
return pds;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
public java.awt.Image getIcon(int iconKind) {
switch (iconKind) {
case BeanInfo.ICON_COLOR_16x16:
return iconColor16x16Filename != null ? loadImage(iconColor16x16Filename) : null;
case BeanInfo.ICON_COLOR_32x32:
return iconColor32x32Filename != null ? loadImage(iconColor32x32Filename) : null;
case BeanInfo.ICON_MONO_16x16:
return iconMono16x16Filename != null ? loadImage(iconMono16x16Filename) : null;
case BeanInfo.ICON_MONO_32x32:
return iconMono32x32Filename != null ? loadImage(iconMono32x32Filename) : null;
}
return null;
}
public BeanInfo[] getAdditionalBeanInfo() {
Class superclass = beanClass.getSuperclass();
try {
BeanInfo superBeanInfo = Introspector.getBeanInfo(superclass);
// return new BeanInfo[] { superBeanInfo };
return null;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
}
/*
* Proview $Id: JopCon_v.java,v 1.2 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.beans;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.awt.font.*;
import javax.swing.*;
import jpwr.jop.*;
public class JopCon_v extends JComponent {
Dimension size;
public JopCon_v()
{
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
size = new Dimension( 40, 40);
}
int borderColor = 9999;
int lineWidth = 1;
public void setBorderColor( int borderColor) {
this.borderColor = borderColor;
}
public int getBorderColor() {
return borderColor;
}
public void setLineWidth( int lineWidth) {
this.lineWidth = lineWidth;
}
public int getLineWidth() {
return lineWidth;
}
int original_width = 40;
int original_height = 40;
public double rotate;
public void setRotate( double rotate) { this.rotate = rotate;}
public double getRotate() { return rotate;}
Shape[] shapes = new Shape[] { null, null,};
float widthOld = 0;
float heightOld = 0;
double rotateOld = 0;
public void paint(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
Component c;
Point p;
paintComponent(g);
for ( int i = 0; i < getComponentCount(); i++) {
AffineTransform save = g.getTransform();
c = getComponent(i);
p = c.getLocation();
g.translate((int)p.getX(), (int)p.getY());
c.paint(g);
g.setTransform(save);
}
}
public void paintComponent(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
float width = getWidth();
float height = getHeight();
if ( shapes[0] == null) {
shapes[0] = new Line2D.Float();
shapes[1] = new Line2D.Float();
}
if ( width != widthOld || height != heightOld || rotate != rotateOld) {
if ( 45.0 <= rotate && rotate < 135.0) {
((Line2D.Float)shapes[0]).setLine(width - 10F, 10F, width - 10F, height);
((Line2D.Float)shapes[1]).setLine(0F, 10F, width - 10F, 10F);
}
else if ( 135.0 <= rotate && rotate < 225.0) {
((Line2D.Float)shapes[0]).setLine(10F, 10F, width, 10F);
((Line2D.Float)shapes[1]).setLine(10F, 10F, 10F, height);
}
else if ( 225.0 <= rotate && rotate < 315.0) {
((Line2D.Float)shapes[0]).setLine(10F, 0F, 10F, height - 10F);
((Line2D.Float)shapes[1]).setLine(10F, height - 10F, width, height - 10F);
}
else {
((Line2D.Float)shapes[0]).setLine(0F, height - 10F, width - 10F, height - 10F);
((Line2D.Float)shapes[1]).setLine(width - 10F, height - 10F, width - 10F, 0F);
}
widthOld = width;
heightOld = height;
rotateOld = rotate;
}
g.setStroke( new BasicStroke((float)lineWidth));
g.setColor(GeColor.getColor(0, borderColor));
g.draw( shapes[0]);
g.draw( shapes[1]);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
/*
* Proview $Id: JopCon_vBeanInfo.java,v 1.2 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.beans;
import jpwr.jop.*;
import java.beans.*;
public class JopCon_vBeanInfo extends SimpleBeanInfo {
Class beanClass = JopCon_v.class;
String iconColor16x16Filename = "jopcon_v16.gif";
String iconColor32x32Filename = "jopcon_v32.gif";
String iconMono16x16Filename;
String iconMono32x32Filename;
public JopCon_vBeanInfo() {
}
public PropertyDescriptor[] getPropertyDescriptors() {
try {
PropertyDescriptor _borderColor = new PropertyDescriptor("borderColor",
beanClass, "getBorderColor", "setBorderColor");
_borderColor.setDisplayName("borderColor");
_borderColor.setShortDescription("borderColor");
_borderColor.setPropertyEditorClass(GeColorEditor.class);
PropertyDescriptor _lineWidth = new PropertyDescriptor("lineWidth",
beanClass, "getLineWidth", "setLineWidth");
_lineWidth.setDisplayName("lineWidth");
_lineWidth.setShortDescription("lineWidth");
PropertyDescriptor _rotate = new PropertyDescriptor("rotate",
beanClass, "getRotate", "setRotate");
_rotate.setDisplayName("rotate");
_rotate.setShortDescription("rotate");
PropertyDescriptor[] pds = new PropertyDescriptor[] {
_borderColor, _lineWidth, _rotate};
return pds;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
public java.awt.Image getIcon(int iconKind) {
switch (iconKind) {
case BeanInfo.ICON_COLOR_16x16:
return iconColor16x16Filename != null ? loadImage(iconColor16x16Filename) : null;
case BeanInfo.ICON_COLOR_32x32:
return iconColor32x32Filename != null ? loadImage(iconColor32x32Filename) : null;
case BeanInfo.ICON_MONO_16x16:
return iconMono16x16Filename != null ? loadImage(iconMono16x16Filename) : null;
case BeanInfo.ICON_MONO_32x32:
return iconMono32x32Filename != null ? loadImage(iconMono32x32Filename) : null;
}
return null;
}
public BeanInfo[] getAdditionalBeanInfo() {
Class superclass = beanClass.getSuperclass();
try {
BeanInfo superBeanInfo = Introspector.getBeanInfo(superclass);
// return new BeanInfo[] { superBeanInfo };
return null;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
}
/*
* Proview $Id: JopDigimage.java,v 1.2 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.beans;
import jpwr.rt.*;
import jpwr.jop.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.awt.font.*;
import javax.swing.*;
import javax.swing.Timer;
import java.awt.event.*;
public class JopDigimage extends JComponent implements JopDynamic, ActionListener{
Dimension size;
Object root;
JopEngine en;
JopSession session;
Timer timer = new Timer(500, this);
private Image normalImage;
private Image lowImage;
private Image currentImage;
public JopDigimage()
{
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
size = new Dimension( 44, 44);
timer.start();
}
public void actionPerformed(ActionEvent e) {
boolean engine_found = false;
Container parent = getParent();
while ( parent != null) {
if ( parent instanceof JopFrame) {
root = parent;
session = ((JopFrame)root).session;
en = ((JopFrame)parent).engine;
if ( !en.isReady())
break;
en.add(this);
engine_found = true;
break;
}
parent = parent.getParent();
}
if ( !engine_found) {
parent = getParent();
while ( parent != null) {
if ( parent instanceof JopApplet) {
root = parent;
session = ((JopApplet)root).session;
en = ((JopApplet)parent).engine;
if ( !en.isReady())
break;
en.add(this);
engine_found = true;
break;
}
parent = parent.getParent();
}
}
if ( engine_found) {
timer.stop();
timer = null;
}
}
public void paint(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
Component c;
Point p;
paintComponent(g);
for ( int i = 0; i < getComponentCount(); i++) {
AffineTransform save = g.getTransform();
c = getComponent(i);
p = c.getLocation();
g.translate((int)p.getX(), (int)p.getY());
c.paint(g);
g.setTransform(save);
}
}
public void paintComponent(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
if ( root == null) {
Container parent = getParent();
while ( parent != null) {
if ( parent instanceof JopFrame) {
root = parent;
session = ((JopFrame)root).session;
break;
}
else if ( parent instanceof JopApplet) {
root = parent;
session = ((JopApplet)root).session;
break;
}
parent = parent.getParent();
}
}
if ( root == null)
return;
if ( (normalImage == null && image != null) ||
(image != null && !image.equals(imageOld))) {
normalImage = JopSpider.getImage( session, image);
imageOld = new String(image);
int imageWidth = normalImage.getWidth(this);
int imageHeight = normalImage.getHeight(this);
if ( valueImage)
currentImage = normalImage;
}
if (lowImage == null && imageLow != null) {
lowImage = JopSpider.getImage( session, imageLow);
int imageWidth = lowImage.getWidth(this);
int imageHeight = lowImage.getHeight(this);
if ( !valueImage)
currentImage = lowImage;
}
if ( currentImage != null)
g.drawImage( currentImage, 0, 0, this);
}
String image = "test.gif";
String imageLow = "test.gif";
public String getImage() {
return image;
}
public void setImage( String image) {
this.image = image;
}
public String getImageLow() {
return imageLow;
}
public void setImageLow( String imageLow) {
this.imageLow = imageLow;
}
private String imageOld;
private float widthOld = 0;
private float heightOld = 0;
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
private String pwrAttribute = new String();
public void setPwrAttribute( String pwrAttribute) { this.pwrAttribute = pwrAttribute;}
public String getPwrAttribute() { return pwrAttribute;}
private boolean valueImage = true;
private boolean valueImageOld;
private boolean firstScan = true;
private GdhrRefObjectInfo retImage = null;
private boolean imageAttrFound = false;
public void dynamicOpen() {
if ( pwrAttribute.compareTo("") != 0) {
retImage = en.gdh.refObjectInfo( pwrAttribute);
if ( retImage.evenSts())
System.out.println( "refObjectInfoError retImage");
else
imageAttrFound = true;
}
}
public void dynamicClose() {
if ( imageAttrFound)
en.gdh.unrefObjectInfo( retImage.refid);
}
public void dynamicUpdate( boolean animationOnly) {
if ( animationOnly)
return;
if ( normalImage == null)
return;
if ( imageAttrFound) {
valueImage = en.gdh.getObjectRefInfoBoolean( retImage.id);
if ( valueImageOld != valueImage || firstScan) {
if ( valueImage) {
currentImage = normalImage;
repaint();
}
else {
currentImage = lowImage;
repaint();
}
}
valueImageOld = valueImage;
}
if ( firstScan)
firstScan = false;
}
public boolean imageUpdate( Image img, int infoflags, int x, int y,
int width, int height) {
if (( infoflags & ImageObserver.ERROR) != 0) {
System.out.println("Error loading image");
}
if ((infoflags & ImageObserver.WIDTH) != 0 &&
(infoflags & ImageObserver.HEIGHT) != 0) {
int imageWidth = img.getWidth(this);
int imageHeight = img.getHeight(this);
}
if ((infoflags & ImageObserver.SOMEBITS) != 0) {
if ( img == currentImage)
repaint();
}
if ((infoflags & ImageObserver.ALLBITS) != 0) {
int imageWidth = img.getWidth(this);
int imageHeight = img.getHeight(this);
if ( img == currentImage)
repaint();
return false;
}
return true;
}
public Object dynamicGetRoot() {
return null;
}
}
/*
* Proview $Id: JopDigimageBeanInfo.java,v 1.2 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.beans;
import jpwr.jop.*;
import java.beans.*;
public class JopDigimageBeanInfo extends SimpleBeanInfo {
Class beanClass = JopDigimage.class;
String iconColor16x16Filename = "jopdigimage16.gif";
String iconColor32x32Filename = "jopdigimage32.gif";
String iconMono16x16Filename;
String iconMono32x32Filename;
public JopDigimageBeanInfo() {
}
public PropertyDescriptor[] getPropertyDescriptors() {
try {
PropertyDescriptor _image = new PropertyDescriptor("image",
beanClass, "getImage", "setImage");
_image.setDisplayName("image");
_image.setShortDescription("image");
PropertyDescriptor _imageLow = new PropertyDescriptor("imageLow",
beanClass, "getImageLow", "setImageLow");
_imageLow.setDisplayName("imageLow");
_imageLow.setShortDescription("imageLow");
PropertyDescriptor _pwrAttribute = new PropertyDescriptor("pwrAttribute",
beanClass, "getPwrAttribute", "setPwrAttribute");
_pwrAttribute.setDisplayName("pwrAttribute");
_pwrAttribute.setShortDescription("pwrAttribute");
PropertyDescriptor _toolTipText = new PropertyDescriptor("toolTipText",
beanClass, "getToolTipText", "setToolTipText");
_toolTipText.setDisplayName("toolTipText");
_toolTipText.setShortDescription("toolTipText");
PropertyDescriptor[] pds = new PropertyDescriptor[] {
_image, _imageLow, _pwrAttribute, _toolTipText};
return pds;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
public java.awt.Image getIcon(int iconKind) {
switch (iconKind) {
case BeanInfo.ICON_COLOR_16x16:
return iconColor16x16Filename != null ? loadImage(iconColor16x16Filename) : null;
case BeanInfo.ICON_COLOR_32x32:
return iconColor32x32Filename != null ? loadImage(iconColor32x32Filename) : null;
case BeanInfo.ICON_MONO_16x16:
return iconMono16x16Filename != null ? loadImage(iconMono16x16Filename) : null;
case BeanInfo.ICON_MONO_32x32:
return iconMono32x32Filename != null ? loadImage(iconMono32x32Filename) : null;
}
return null;
}
public BeanInfo[] getAdditionalBeanInfo() {
Class superclass = beanClass.getSuperclass();
try {
BeanInfo superBeanInfo = Introspector.getBeanInfo(superclass);
return null;
// return new BeanInfo[] { superBeanInfo };
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
}
/*
* Proview $Id: JopDynamicBeanInfo.java,v 1.2 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.jop;
import java.beans.*;
public class JopDynamicBeanInfo extends SimpleBeanInfo {
Class beanClass = JopDynamic.class;
public JopDynamicBeanInfo() {
}
public PropertyDescriptor[] getPropertyDescriptors() {
PropertyDescriptor[] pds = new PropertyDescriptor[] {};
return pds;
}
public java.awt.Image getIcon(int iconKind) {
return null;
}
public BeanInfo[] getAdditionalBeanInfo() {
Class superclass = beanClass.getSuperclass();
try {
BeanInfo superBeanInfo = Introspector.getBeanInfo(superclass);
return new BeanInfo[] { superBeanInfo };
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
}
/*
* Proview $Id: JopFilter.java,v 1.3 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.beans;
import jpwr.rt.*;
import jpwr.jop.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.awt.font.*;
import javax.swing.*;
import javax.swing.Timer;
import java.awt.event.*;
public class JopFilter extends JComponent implements JopDynamic, ActionListener{
Dimension size;
Object root;
JopEngine en;
Timer timer = new Timer(500, this);
public JopFilter()
{
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
size = new Dimension( 44, 44);
timer.start();
}
public void actionPerformed(ActionEvent e) {
boolean engine_found = false;
Container parent = getParent();
while ( parent != null) {
if ( parent instanceof JopFrame) {
en = ((JopFrame)parent).engine;
if ( !en.isReady())
break;
en.add(this);
root = parent;
engine_found = true;
break;
}
parent = parent.getParent();
}
if ( !engine_found) {
parent = getParent();
while ( parent != null) {
if ( parent instanceof JopApplet) {
en = ((JopApplet)parent).engine;
if ( !en.isReady())
break;
en.add(this);
root = parent;
engine_found = true;
break;
}
parent = parent.getParent();
}
}
if ( engine_found) {
timer.stop();
timer = null;
}
}
int fillColor = 9999;
int originalFillColor = 9999;
int borderColor = 9999;
int colorTone = 0;
int originalColorTone = 0;
int colorShift = 0;
int originalColorShift = 0;
int colorBrightness = 0;
int originalColorBrightness = 0;
int colorIntensity = 0;
int originalColorIntensity = 0;
int colorInverse = 0;
int originalColorInverse = 0;
public void setColorTone( int colorTone) {
this.colorTone = colorTone;
originalColorTone = colorTone;
}
public int getColorTone() {
return colorTone;
}
public void setColorShift( int colorShift) {
this.colorShift = colorShift;
originalColorShift = colorShift;
}
public int getColorShift() {
return colorShift;
}
public void setColorBrightness( int colorBrightness) {
this.colorBrightness = colorBrightness;
originalColorBrightness = colorBrightness;
}
public int getColorBrightness() {
return colorBrightness;
}
public void setColorIntensity( int colorIntensity) {
this.colorIntensity = colorIntensity;
originalColorIntensity = colorIntensity;
}
public int getColorIntensity() {
return colorIntensity;
}
public void setFillColor( int fillColor) {
this.fillColor = fillColor;
this.originalFillColor = fillColor;
}
public void resetFillColor() {
fillColor = originalFillColor;
}
public int getFillColor() {
return fillColor;
}
public void setBorderColor( int borderColor) {
this.borderColor = borderColor;
}
public int getBorderColor() {
return borderColor;
}
int original_width = 44;
int original_height = 44;
double rotate;
public void setRotate( double rotate) {
if ( rotate < 0)
this.rotate = rotate % 360 + 360;
else
this.rotate = rotate % 360;
}
public double getRotate() { return rotate;}
Shape[] shapes = new Shape[] {
new Polygon( new int[] { 22, 2, 22, 42, 22}, new int[] {2, 22, 42, 22, 2}, 5),
new Line2D.Float( 42F, 22F, 2F, 22F),
};
public void paint(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
Component c;
Point p;
paintComponent(g);
for ( int i = 0; i < getComponentCount(); i++) {
AffineTransform save = g.getTransform();
c = getComponent(i);
p = c.getLocation();
g.translate((int)p.getX(), (int)p.getY());
c.paint(g);
g.setTransform(save);
}
}
public void paintComponent(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
g.setColor(GeColor.getColor(21, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false));
g.fill( shapes[0]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[0]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[1]);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
int lowColor = 1;
public void setLowColor( int lowColor) { this.lowColor = lowColor;}
public int getLowColor() { return lowColor;}
String pwrAttribute = new String();
public void setPwrAttribute( String pwrAttribute) { this.pwrAttribute = pwrAttribute;}
public String getPwrAttribute() { return pwrAttribute;}
boolean valueColor;
boolean valueColorOld;
boolean firstScan = true;
GdhrRefObjectInfo retColor = null;
boolean colorAttrFound = false;
public void dynamicOpen() {
if ( pwrAttribute.compareTo("") != 0) {
retColor = en.gdh.refObjectInfo( pwrAttribute);
if ( retColor.evenSts())
System.out.println( "refObjectInfoError retColor");
else
colorAttrFound = true;
}
}
public void dynamicClose() {
if ( colorAttrFound)
en.gdh.unrefObjectInfo( retColor.refid);
}
public void dynamicUpdate( boolean animationOnly) {
if ( animationOnly)
return;
if ( colorAttrFound) {
valueColor = en.gdh.getObjectRefInfoBoolean( retColor.id);
if ( valueColorOld != valueColor || firstScan) {
if ( valueColor) {
fillColor = originalFillColor;
repaint();
}
else {
fillColor = lowColor;
repaint();
}
}
valueColorOld = valueColor;
}
if ( firstScan)
firstScan = false;
}
public Object dynamicGetRoot() {
return null;
}
}
/*
* Proview $Id: JopFilterBeanInfo.java,v 1.2 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.beans;
import jpwr.jop.*;
import java.beans.*;
public class JopFilterBeanInfo extends SimpleBeanInfo {
Class beanClass = JopFilter.class;
String iconColor16x16Filename = "jopfilter16.gif";
String iconColor32x32Filename = "jopfilter32.gif";
String iconMono16x16Filename;
String iconMono32x32Filename;
public JopFilterBeanInfo() {
}
public PropertyDescriptor[] getPropertyDescriptors() {
try {
PropertyDescriptor _toolTipText = new PropertyDescriptor("toolTipText",
beanClass, "getToolTipText", "setToolTipText");
_toolTipText.setDisplayName("toolTipText");
_toolTipText.setShortDescription("toolTipText");
PropertyDescriptor _fillColor = new PropertyDescriptor("fillColor",
beanClass, "getFillColor", "setFillColor");
_fillColor.setDisplayName("fillColor");
_fillColor.setShortDescription("fillColor");
_fillColor.setPropertyEditorClass(GeColorEditor.class);
PropertyDescriptor _borderColor = new PropertyDescriptor("borderColor",
beanClass, "getBorderColor", "setBorderColor");
_borderColor.setDisplayName("borderColor");
_borderColor.setShortDescription("borderColor");
_borderColor.setPropertyEditorClass(GeColorEditor.class);
PropertyDescriptor _colorTone = new PropertyDescriptor("colorTone",
beanClass, "getColorTone", "setColorTone");
_colorTone.setDisplayName("colorTone");
_colorTone.setShortDescription("colorTone");
_colorTone.setPropertyEditorClass(GeColorToneEditor.class);
PropertyDescriptor _colorShift = new PropertyDescriptor("colorShift",
beanClass, "getColorShift", "setColorShift");
_colorShift.setDisplayName("colorShift");
_colorShift.setShortDescription("colorShift");
_colorShift.setPropertyEditorClass(GeColorShiftEditor.class);
PropertyDescriptor _colorBrightness = new PropertyDescriptor("colorBrightness",
beanClass, "getColorBrightness", "setColorBrightness");
_colorBrightness.setDisplayName("colorBrightness");
_colorBrightness.setShortDescription("colorBrightness");
_colorBrightness.setPropertyEditorClass(GeColorBrightnessEditor.class);
PropertyDescriptor _colorIntensity = new PropertyDescriptor("colorIntensity",
beanClass, "getColorIntensity", "setColorIntensity");
_colorIntensity.setDisplayName("colorIntensity");
_colorIntensity.setShortDescription("colorIntensity");
_colorIntensity.setPropertyEditorClass(GeColorIntensityEditor.class);
PropertyDescriptor _rotate = new PropertyDescriptor("rotate",
beanClass, "getRotate", "setRotate");
_rotate.setDisplayName("rotate");
_rotate.setShortDescription("rotate");
PropertyDescriptor _lowColor = new PropertyDescriptor("lowColor",
beanClass, "getLowColor", "setLowColor");
_lowColor.setDisplayName("lowColor");
_lowColor.setShortDescription("lowColor");
_lowColor.setPropertyEditorClass(GeColorEditor.class);
PropertyDescriptor _pwrAttribute = new PropertyDescriptor("pwrAttribute",
beanClass, "getPwrAttribute", "setPwrAttribute");
_pwrAttribute.setDisplayName("pwrAttribute");
_pwrAttribute.setShortDescription("pwrAttribute");
PropertyDescriptor[] pds = new PropertyDescriptor[] {
_toolTipText, _fillColor, _borderColor, _colorTone, _colorShift,
_colorBrightness, _colorIntensity, _rotate,
_lowColor, _pwrAttribute};
return pds;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
public java.awt.Image getIcon(int iconKind) {
switch (iconKind) {
case BeanInfo.ICON_COLOR_16x16:
return iconColor16x16Filename != null ? loadImage(iconColor16x16Filename) : null;
case BeanInfo.ICON_COLOR_32x32:
return iconColor32x32Filename != null ? loadImage(iconColor32x32Filename) : null;
case BeanInfo.ICON_MONO_16x16:
return iconMono16x16Filename != null ? loadImage(iconMono16x16Filename) : null;
case BeanInfo.ICON_MONO_32x32:
return iconMono32x32Filename != null ? loadImage(iconMono32x32Filename) : null;
}
return null;
}
public BeanInfo[] getAdditionalBeanInfo() {
Class superclass = beanClass.getSuperclass();
try {
BeanInfo superBeanInfo = Introspector.getBeanInfo(superclass);
// return new BeanInfo[] { superBeanInfo };
return null;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
}
/*
* Proview $Id: JopFramemedium.java,v 1.3 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.beans;
import jpwr.rt.*;
import jpwr.jop.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.awt.font.*;
import javax.swing.*;
public class JopFramemedium extends JComponent {
Dimension size;
public JopFramemedium()
{
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
size = new Dimension( 244, 144);
}
int fillColor = 9999;
int originalFillColor = 9999;
int borderColor = 9999;
int colorTone = 0;
int originalColorTone = 0;
int colorShift = 0;
int originalColorShift = 0;
int colorBrightness = 0;
int originalColorBrightness = 0;
int colorIntensity = 0;
int originalColorIntensity = 0;
int colorInverse = 0;
int originalColorInverse = 0;
public void setColorTone( int colorTone) {
this.colorTone = colorTone;
originalColorTone = colorTone;
}
public int getColorTone() {
return colorTone;
}
public void setColorShift( int colorShift) {
this.colorShift = colorShift;
originalColorShift = colorShift;
}
public int getColorShift() {
return colorShift;
}
public void setColorBrightness( int colorBrightness) {
this.colorBrightness = colorBrightness;
originalColorBrightness = colorBrightness;
}
public int getColorBrightness() {
return colorBrightness;
}
public void setColorIntensity( int colorIntensity) {
this.colorIntensity = colorIntensity;
originalColorIntensity = colorIntensity;
}
public int getColorIntensity() {
return colorIntensity;
}
public void setFillColor( int fillColor) {
this.fillColor = fillColor;
this.originalFillColor = fillColor;
}
public void resetFillColor() {
fillColor = originalFillColor;
}
public int getFillColor() {
return fillColor;
}
public void setBorderColor( int borderColor) {
this.borderColor = borderColor;
}
public int getBorderColor() {
return borderColor;
}
int original_width = 244;
int original_height = 144;
double rotate;
public void setRotate( double rotate) {
if ( rotate < 0)
this.rotate = rotate % 360 + 360;
else
this.rotate = rotate % 360;
}
public double getRotate() { return rotate;}
Shape[] shapes = new Shape[] {
new Polygon( new int[] { 2, 8, 236, 242, 2}, new int[] {2, 8, 8, 2, 2}, 5),
new Polygon( new int[] { 2, 8, 8, 2, 2}, new int[] {2, 8, 136, 142, 2}, 5),
new Polygon( new int[] { 236, 236, 242, 242, 236}, new int[] {8, 136, 142, 2, 8}, 5),
new Polygon( new int[] { 2, 8, 236, 242, 2}, new int[] {142, 136, 136, 142, 142}, 5),
};
public void paint(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
Component c;
Point p;
paintComponent(g);
for ( int i = 0; i < getComponentCount(); i++) {
AffineTransform save = g.getTransform();
c = getComponent(i);
p = c.getLocation();
g.translate((int)p.getX(), (int)p.getY());
c.paint(g);
g.setTransform(save);
}
}
public void paintComponent(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
g.setColor(GeColor.getColor(30, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false));
g.fill( shapes[0]);
g.setColor(GeColor.getColor(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false));
g.fill( shapes[1]);
g.setColor(GeColor.getColor(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false));
g.fill( shapes[2]);
g.setColor(GeColor.getColor(33, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false));
g.fill( shapes[3]);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
/*
* Proview $Id: JopFramemediumBeanInfo.java,v 1.2 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.beans;
import jpwr.jop.*;
import java.beans.*;
public class JopFramemediumBeanInfo extends SimpleBeanInfo {
Class beanClass = JopFramemedium.class;
String iconColor16x16Filename = "jopframemedium16.gif";
String iconColor32x32Filename = "jopframemedium32.gif";
String iconMono16x16Filename;
String iconMono32x32Filename;
public JopFramemediumBeanInfo() {
}
public PropertyDescriptor[] getPropertyDescriptors() {
try {
PropertyDescriptor _toolTipText = new PropertyDescriptor("toolTipText",
beanClass, "getToolTipText", "setToolTipText");
_toolTipText.setDisplayName("toolTipText");
_toolTipText.setShortDescription("toolTipText");
PropertyDescriptor _fillColor = new PropertyDescriptor("fillColor",
beanClass, "getFillColor", "setFillColor");
_fillColor.setDisplayName("fillColor");
_fillColor.setShortDescription("fillColor");
_fillColor.setPropertyEditorClass(GeColorEditor.class);
PropertyDescriptor _borderColor = new PropertyDescriptor("borderColor",
beanClass, "getBorderColor", "setBorderColor");
_borderColor.setDisplayName("borderColor");
_borderColor.setShortDescription("borderColor");
_borderColor.setPropertyEditorClass(GeColorEditor.class);
PropertyDescriptor _colorTone = new PropertyDescriptor("colorTone",
beanClass, "getColorTone", "setColorTone");
_colorTone.setDisplayName("colorTone");
_colorTone.setShortDescription("colorTone");
_colorTone.setPropertyEditorClass(GeColorToneEditor.class);
PropertyDescriptor _colorShift = new PropertyDescriptor("colorShift",
beanClass, "getColorShift", "setColorShift");
_colorShift.setDisplayName("colorShift");
_colorShift.setShortDescription("colorShift");
_colorShift.setPropertyEditorClass(GeColorShiftEditor.class);
PropertyDescriptor _colorBrightness = new PropertyDescriptor("colorBrightness",
beanClass, "getColorBrightness", "setColorBrightness");
_colorBrightness.setDisplayName("colorBrightness");
_colorBrightness.setShortDescription("colorBrightness");
_colorBrightness.setPropertyEditorClass(GeColorBrightnessEditor.class);
PropertyDescriptor _colorIntensity = new PropertyDescriptor("colorIntensity",
beanClass, "getColorIntensity", "setColorIntensity");
_colorIntensity.setDisplayName("colorIntensity");
_colorIntensity.setShortDescription("colorIntensity");
_colorIntensity.setPropertyEditorClass(GeColorIntensityEditor.class);
PropertyDescriptor _rotate = new PropertyDescriptor("rotate",
beanClass, "getRotate", "setRotate");
_rotate.setDisplayName("rotate");
_rotate.setShortDescription("rotate");
PropertyDescriptor[] pds = new PropertyDescriptor[] {
_toolTipText, _fillColor, _borderColor, _colorTone, _colorShift,
_colorBrightness, _colorIntensity, _rotate};
return pds;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
public java.awt.Image getIcon(int iconKind) {
switch (iconKind) {
case BeanInfo.ICON_COLOR_16x16:
return iconColor16x16Filename != null ? loadImage(iconColor16x16Filename) : null;
case BeanInfo.ICON_COLOR_32x32:
return iconColor32x32Filename != null ? loadImage(iconColor32x32Filename) : null;
case BeanInfo.ICON_MONO_16x16:
return iconMono16x16Filename != null ? loadImage(iconMono16x16Filename) : null;
case BeanInfo.ICON_MONO_32x32:
return iconMono32x32Filename != null ? loadImage(iconMono32x32Filename) : null;
}
return null;
}
public BeanInfo[] getAdditionalBeanInfo() {
Class superclass = beanClass.getSuperclass();
try {
BeanInfo superBeanInfo = Introspector.getBeanInfo(superclass);
// return new BeanInfo[] { superBeanInfo };
return null;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
}
/*
* Proview $Id: JopFrameroundcorners.java,v 1.3 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.beans;
import jpwr.rt.*;
import jpwr.jop.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.awt.font.*;
import javax.swing.*;
public class JopFrameroundcorners extends JComponent {
Dimension size;
public JopFrameroundcorners()
{
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
size = new Dimension( 264, 184);
}
int fillColor = 9999;
int originalFillColor = 9999;
int borderColor = 9999;
int colorTone = 0;
int originalColorTone = 0;
int colorShift = 0;
int originalColorShift = 0;
int colorBrightness = 0;
int originalColorBrightness = 0;
int colorIntensity = 0;
int originalColorIntensity = 0;
int colorInverse = 0;
int originalColorInverse = 0;
public void setColorTone( int colorTone) {
this.colorTone = colorTone;
originalColorTone = colorTone;
}
public int getColorTone() {
return colorTone;
}
public void setColorShift( int colorShift) {
this.colorShift = colorShift;
originalColorShift = colorShift;
}
public int getColorShift() {
return colorShift;
}
public void setColorBrightness( int colorBrightness) {
this.colorBrightness = colorBrightness;
originalColorBrightness = colorBrightness;
}
public int getColorBrightness() {
return colorBrightness;
}
public void setColorIntensity( int colorIntensity) {
this.colorIntensity = colorIntensity;
originalColorIntensity = colorIntensity;
}
public int getColorIntensity() {
return colorIntensity;
}
public void setFillColor( int fillColor) {
this.fillColor = fillColor;
this.originalFillColor = fillColor;
}
public void resetFillColor() {
fillColor = originalFillColor;
}
public int getFillColor() {
return fillColor;
}
public void setBorderColor( int borderColor) {
this.borderColor = borderColor;
}
public int getBorderColor() {
return borderColor;
}
int original_width = 264;
int original_height = 184;
double rotate;
public void setRotate( double rotate) {
if ( rotate < 0)
this.rotate = rotate % 360 + 360;
else
this.rotate = rotate % 360;
}
public double getRotate() { return rotate;}
Shape[] shapes = new Shape[] {
new Arc2D.Float(2F, 142F, 40F, 40F, 225F, 45F, Arc2D.OPEN),
new Arc2D.Float(222F, 142F, 40F, 40F, 315F, 45F, Arc2D.OPEN),
new Arc2D.Float(222F, 2F, 40F, 40F, 0F, 45F, Arc2D.OPEN),
new Arc2D.Float(2F, 2F, 40F, 40F, 90F, 45F, Arc2D.OPEN),
new Arc2D.Float(222F, 2F, 40F, 40F, 45F, 45F, Arc2D.OPEN),
new Arc2D.Float(2F, 142F, 40F, 40F, 180F, 45F, Arc2D.OPEN),
new Arc2D.Float(222F, 142F, 40F, 40F, 270F, 45F, Arc2D.OPEN),
new Line2D.Float( 242F, 2F, 22F, 2F),
new Line2D.Float( 2F, 162F, 2F, 22F),
new Line2D.Float( 242F, 182F, 22F, 182F),
new Line2D.Float( 262F, 162F, 262F, 22F),
new Arc2D.Float(2F, 2F, 40F, 40F, 135F, 45F, Arc2D.OPEN),
};
public void paint(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
Component c;
Point p;
paintComponent(g);
for ( int i = 0; i < getComponentCount(); i++) {
AffineTransform save = g.getTransform();
c = getComponent(i);
p = c.getLocation();
g.translate((int)p.getX(), (int)p.getY());
c.paint(g);
g.setTransform(save);
}
}
public void paintComponent(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
g.setStroke( new BasicStroke(2F));
g.setColor(GeColor.getColor(30, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[0]);
g.setStroke( new BasicStroke(2F));
g.setColor(GeColor.getColor(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[1]);
g.setStroke( new BasicStroke(2F));
g.setColor(GeColor.getColor(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[2]);
g.setStroke( new BasicStroke(2F));
g.setColor(GeColor.getColor(33, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[3]);
g.setStroke( new BasicStroke(2F));
g.setColor(GeColor.getColor(33, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[4]);
g.setStroke( new BasicStroke(2F));
g.setColor(GeColor.getColor(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[5]);
g.setStroke( new BasicStroke(2F));
g.setColor(GeColor.getColor(30, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[6]);
g.setStroke( new BasicStroke(2F));
g.setColor(GeColor.getColor(33, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[7]);
g.setStroke( new BasicStroke(2F));
g.setColor(GeColor.getColor(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[8]);
g.setStroke( new BasicStroke(2F));
g.setColor(GeColor.getColor(30, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[9]);
g.setStroke( new BasicStroke(2F));
g.setColor(GeColor.getColor(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[10]);
g.setStroke( new BasicStroke(2F));
g.setColor(GeColor.getColor(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[11]);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
/*
* Proview $Id: JopFrameroundcornersBeanInfo.java,v 1.2 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.beans;
import jpwr.jop.*;
import java.beans.*;
public class JopFrameroundcornersBeanInfo extends SimpleBeanInfo {
Class beanClass = JopFrameroundcorners.class;
String iconColor16x16Filename = "jopframeroundcorners16.gif";
String iconColor32x32Filename = "jopframeroundcorners32.gif";
String iconMono16x16Filename;
String iconMono32x32Filename;
public JopFrameroundcornersBeanInfo() {
}
public PropertyDescriptor[] getPropertyDescriptors() {
try {
PropertyDescriptor _fillColor = new PropertyDescriptor("fillColor",
beanClass, "getFillColor", "setFillColor");
_fillColor.setDisplayName("fillColor");
_fillColor.setShortDescription("fillColor");
_fillColor.setPropertyEditorClass(GeColorEditor.class);
PropertyDescriptor _borderColor = new PropertyDescriptor("borderColor",
beanClass, "getBorderColor", "setBorderColor");
_borderColor.setDisplayName("borderColor");
_borderColor.setShortDescription("borderColor");
_borderColor.setPropertyEditorClass(GeColorEditor.class);
PropertyDescriptor _colorTone = new PropertyDescriptor("colorTone",
beanClass, "getColorTone", "setColorTone");
_colorTone.setDisplayName("colorTone");
_colorTone.setShortDescription("colorTone");
_colorTone.setPropertyEditorClass(GeColorToneEditor.class);
PropertyDescriptor _colorShift = new PropertyDescriptor("colorShift",
beanClass, "getColorShift", "setColorShift");
_colorShift.setDisplayName("colorShift");
_colorShift.setShortDescription("colorShift");
_colorShift.setPropertyEditorClass(GeColorShiftEditor.class);
PropertyDescriptor _colorBrightness = new PropertyDescriptor("colorBrightness",
beanClass, "getColorBrightness", "setColorBrightness");
_colorBrightness.setDisplayName("colorBrightness");
_colorBrightness.setShortDescription("colorBrightness");
_colorBrightness.setPropertyEditorClass(GeColorBrightnessEditor.class);
PropertyDescriptor _colorIntensity = new PropertyDescriptor("colorIntensity",
beanClass, "getColorIntensity", "setColorIntensity");
_colorIntensity.setDisplayName("colorIntensity");
_colorIntensity.setShortDescription("colorIntensity");
_colorIntensity.setPropertyEditorClass(GeColorIntensityEditor.class);
PropertyDescriptor _rotate = new PropertyDescriptor("rotate",
beanClass, "getRotate", "setRotate");
_rotate.setDisplayName("rotate");
_rotate.setShortDescription("rotate");
PropertyDescriptor[] pds = new PropertyDescriptor[] {
_fillColor, _borderColor, _colorTone, _colorShift,
_colorBrightness, _colorIntensity, _rotate};
return pds;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
public java.awt.Image getIcon(int iconKind) {
switch (iconKind) {
case BeanInfo.ICON_COLOR_16x16:
return iconColor16x16Filename != null ? loadImage(iconColor16x16Filename) : null;
case BeanInfo.ICON_COLOR_32x32:
return iconColor32x32Filename != null ? loadImage(iconColor32x32Filename) : null;
case BeanInfo.ICON_MONO_16x16:
return iconMono16x16Filename != null ? loadImage(iconMono16x16Filename) : null;
case BeanInfo.ICON_MONO_32x32:
return iconMono32x32Filename != null ? loadImage(iconMono32x32Filename) : null;
}
return null;
}
public BeanInfo[] getAdditionalBeanInfo() {
Class superclass = beanClass.getSuperclass();
try {
BeanInfo superBeanInfo = Introspector.getBeanInfo(superclass);
return new BeanInfo[] { superBeanInfo };
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
}
/*
* Proview $Id: JopFramethick.java,v 1.3 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.beans;
import jpwr.rt.*;
import jpwr.jop.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.awt.font.*;
import javax.swing.*;
public class JopFramethick extends JComponent {
Dimension size;
public JopFramethick()
{
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
size = new Dimension( 244, 144);
}
int fillColor = 9999;
int originalFillColor = 9999;
int borderColor = 9999;
int colorTone = 0;
int originalColorTone = 0;
int colorShift = 0;
int originalColorShift = 0;
int colorBrightness = 0;
int originalColorBrightness = 0;
int colorIntensity = 0;
int originalColorIntensity = 0;
int colorInverse = 0;
int originalColorInverse = 0;
public void setColorTone( int colorTone) {
this.colorTone = colorTone;
originalColorTone = colorTone;
}
public int getColorTone() {
return colorTone;
}
public void setColorShift( int colorShift) {
this.colorShift = colorShift;
originalColorShift = colorShift;
}
public int getColorShift() {
return colorShift;
}
public void setColorBrightness( int colorBrightness) {
this.colorBrightness = colorBrightness;
originalColorBrightness = colorBrightness;
}
public int getColorBrightness() {
return colorBrightness;
}
public void setColorIntensity( int colorIntensity) {
this.colorIntensity = colorIntensity;
originalColorIntensity = colorIntensity;
}
public int getColorIntensity() {
return colorIntensity;
}
public void setFillColor( int fillColor) {
this.fillColor = fillColor;
this.originalFillColor = fillColor;
}
public void resetFillColor() {
fillColor = originalFillColor;
}
public int getFillColor() {
return fillColor;
}
public void setBorderColor( int borderColor) {
this.borderColor = borderColor;
}
public int getBorderColor() {
return borderColor;
}
int original_width = 244;
int original_height = 144;
double rotate;
public void setRotate( double rotate) {
if ( rotate < 0)
this.rotate = rotate % 360 + 360;
else
this.rotate = rotate % 360;
}
public double getRotate() { return rotate;}
Shape[] shapes = new Shape[] {
new Polygon( new int[] { 2, 12, 232, 242, 2}, new int[] {2, 12, 12, 2, 2}, 5),
new Polygon( new int[] { 2, 12, 12, 2, 2}, new int[] {2, 12, 132, 142, 2}, 5),
new Polygon( new int[] { 232, 232, 242, 242, 232}, new int[] {12, 132, 142, 2, 12}, 5),
new Polygon( new int[] { 2, 12, 232, 242, 2}, new int[] {142, 132, 132, 142, 142}, 5),
};
public void paint(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
Component c;
Point p;
paintComponent(g);
for ( int i = 0; i < getComponentCount(); i++) {
AffineTransform save = g.getTransform();
c = getComponent(i);
p = c.getLocation();
g.translate((int)p.getX(), (int)p.getY());
c.paint(g);
g.setTransform(save);
}
}
public void paintComponent(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
g.setColor(GeColor.getColor(30, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false));
g.fill( shapes[0]);
g.setColor(GeColor.getColor(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false));
g.fill( shapes[1]);
g.setColor(GeColor.getColor(32, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false));
g.fill( shapes[2]);
g.setColor(GeColor.getColor(33, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false));
g.fill( shapes[3]);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
/*
* Proview $Id: JopFramethickBeanInfo.java,v 1.2 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.beans;
import jpwr.jop.*;
import java.beans.*;
public class JopFramethickBeanInfo extends SimpleBeanInfo {
Class beanClass = JopFramethick.class;
String iconColor16x16Filename = "jopframethick16.gif";
String iconColor32x32Filename = "jopframethick32.gif";
String iconMono16x16Filename;
String iconMono32x32Filename;
public JopFramethickBeanInfo() {
}
public PropertyDescriptor[] getPropertyDescriptors() {
try {
PropertyDescriptor _toolTipText = new PropertyDescriptor("toolTipText",
beanClass, "getToolTipText", "setToolTipText");
_toolTipText.setDisplayName("toolTipText");
_toolTipText.setShortDescription("toolTipText");
PropertyDescriptor _fillColor = new PropertyDescriptor("fillColor",
beanClass, "getFillColor", "setFillColor");
_fillColor.setDisplayName("fillColor");
_fillColor.setShortDescription("fillColor");
_fillColor.setPropertyEditorClass(GeColorEditor.class);
PropertyDescriptor _borderColor = new PropertyDescriptor("borderColor",
beanClass, "getBorderColor", "setBorderColor");
_borderColor.setDisplayName("borderColor");
_borderColor.setShortDescription("borderColor");
_borderColor.setPropertyEditorClass(GeColorEditor.class);
PropertyDescriptor _colorTone = new PropertyDescriptor("colorTone",
beanClass, "getColorTone", "setColorTone");
_colorTone.setDisplayName("colorTone");
_colorTone.setShortDescription("colorTone");
_colorTone.setPropertyEditorClass(GeColorToneEditor.class);
PropertyDescriptor _colorShift = new PropertyDescriptor("colorShift",
beanClass, "getColorShift", "setColorShift");
_colorShift.setDisplayName("colorShift");
_colorShift.setShortDescription("colorShift");
_colorShift.setPropertyEditorClass(GeColorShiftEditor.class);
PropertyDescriptor _colorBrightness = new PropertyDescriptor("colorBrightness",
beanClass, "getColorBrightness", "setColorBrightness");
_colorBrightness.setDisplayName("colorBrightness");
_colorBrightness.setShortDescription("colorBrightness");
_colorBrightness.setPropertyEditorClass(GeColorBrightnessEditor.class);
PropertyDescriptor _colorIntensity = new PropertyDescriptor("colorIntensity",
beanClass, "getColorIntensity", "setColorIntensity");
_colorIntensity.setDisplayName("colorIntensity");
_colorIntensity.setShortDescription("colorIntensity");
_colorIntensity.setPropertyEditorClass(GeColorIntensityEditor.class);
PropertyDescriptor _rotate = new PropertyDescriptor("rotate",
beanClass, "getRotate", "setRotate");
_rotate.setDisplayName("rotate");
_rotate.setShortDescription("rotate");
PropertyDescriptor[] pds = new PropertyDescriptor[] {
_toolTipText, _fillColor, _borderColor, _colorTone, _colorShift,
_colorBrightness, _colorIntensity, _rotate};
return pds;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
public java.awt.Image getIcon(int iconKind) {
switch (iconKind) {
case BeanInfo.ICON_COLOR_16x16:
return iconColor16x16Filename != null ? loadImage(iconColor16x16Filename) : null;
case BeanInfo.ICON_COLOR_32x32:
return iconColor32x32Filename != null ? loadImage(iconColor32x32Filename) : null;
case BeanInfo.ICON_MONO_16x16:
return iconMono16x16Filename != null ? loadImage(iconMono16x16Filename) : null;
case BeanInfo.ICON_MONO_32x32:
return iconMono32x32Filename != null ? loadImage(iconMono32x32Filename) : null;
}
return null;
}
public BeanInfo[] getAdditionalBeanInfo() {
Class superclass = beanClass.getSuperclass();
try {
BeanInfo superBeanInfo = Introspector.getBeanInfo(superclass);
// return new BeanInfo[] { superBeanInfo };
return null;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
}
/*
* Proview $Id: JopFramethin.java,v 1.3 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.beans;
import jpwr.rt.*;
import jpwr.jop.*;
import java.awt.*;
import java.awt.geom.*;
import java.awt.image.*;
import java.awt.font.*;
import javax.swing.*;
public class JopFramethin extends JComponent {
Dimension size;
public JopFramethin()
{
try {
jbInit();
}
catch(Exception e) {
e.printStackTrace();
}
}
private void jbInit() throws Exception {
size = new Dimension( 144, 84);
}
int fillColor = 9999;
int originalFillColor = 9999;
int borderColor = 9999;
int colorTone = 0;
int originalColorTone = 0;
int colorShift = 0;
int originalColorShift = 0;
int colorBrightness = 0;
int originalColorBrightness = 0;
int colorIntensity = 0;
int originalColorIntensity = 0;
int colorInverse = 0;
int originalColorInverse = 0;
public void setColorTone( int colorTone) {
this.colorTone = colorTone;
originalColorTone = colorTone;
}
public int getColorTone() {
return colorTone;
}
public void setColorShift( int colorShift) {
this.colorShift = colorShift;
originalColorShift = colorShift;
}
public int getColorShift() {
return colorShift;
}
public void setColorBrightness( int colorBrightness) {
this.colorBrightness = colorBrightness;
originalColorBrightness = colorBrightness;
}
public int getColorBrightness() {
return colorBrightness;
}
public void setColorIntensity( int colorIntensity) {
this.colorIntensity = colorIntensity;
originalColorIntensity = colorIntensity;
}
public int getColorIntensity() {
return colorIntensity;
}
public void setFillColor( int fillColor) {
this.fillColor = fillColor;
this.originalFillColor = fillColor;
}
public void resetFillColor() {
fillColor = originalFillColor;
}
public int getFillColor() {
return fillColor;
}
public void setBorderColor( int borderColor) {
this.borderColor = borderColor;
}
public int getBorderColor() {
return borderColor;
}
int original_width = 144;
int original_height = 84;
double rotate;
public void setRotate( double rotate) {
if ( rotate < 0)
this.rotate = rotate % 360 + 360;
else
this.rotate = rotate % 360;
}
public double getRotate() { return rotate;}
Shape[] shapes = new Shape[] {
new Line2D.Float( 142F, 2F, 2F, 2F),
new Line2D.Float( 2F, 82F, 2F, 2F),
new Line2D.Float( 142F, 82F, 2F, 82F),
new Line2D.Float( 142F, 82F, 142F, 2F),
};
public void paint(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
Component c;
Point p;
paintComponent(g);
for ( int i = 0; i < getComponentCount(); i++) {
AffineTransform save = g.getTransform();
c = getComponent(i);
p = c.getLocation();
g.translate((int)p.getX(), (int)p.getY());
c.paint(g);
g.setTransform(save);
}
}
public void paintComponent(Graphics g1) {
Graphics2D g = (Graphics2D) g1;
float width = getWidth();
float height = getHeight();
AffineTransform save = g.getTransform();
AffineTransform save_tmp;
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
if ( 45.0 <= rotate && rotate < 135.0) {
g.translate( width, 0.0);
g.rotate( Math.PI * rotate/180, 0.0, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else if ( 135.0 <= rotate && rotate < 225.0)
{
g.rotate( Math.PI * rotate/180, width/2, height/2);
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
}
else if ( 225.0 <= rotate && rotate < 315.0)
{
g.translate( -height, 0.0);
g.rotate( Math.PI * rotate/180, height, 0.0);
g.transform( AffineTransform.getScaleInstance( height/original_width,
width/original_height));
}
else
g.transform( AffineTransform.getScaleInstance( width/original_width,
height/original_height));
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(24, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[0]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(24, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[1]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(10, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[2]);
g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(10, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[3]);
g.setTransform(save);
}
public Dimension getPreferredSize() { return size;}
public Dimension getMinimumSize() { return size;}
}
/*
* Proview $Id: JopFramethinBeanInfo.java,v 1.2 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.beans;
import jpwr.jop.*;
import java.beans.*;
public class JopFramethinBeanInfo extends SimpleBeanInfo {
Class beanClass = JopFramethin.class;
String iconColor16x16Filename = "jopframethin16.gif";
String iconColor32x32Filename = "jopframethin32.gif";
String iconMono16x16Filename;
String iconMono32x32Filename;
public JopFramethinBeanInfo() {
}
public PropertyDescriptor[] getPropertyDescriptors() {
try {
PropertyDescriptor _toolTipText = new PropertyDescriptor("toolTipText",
beanClass, "getToolTipText", "setToolTipText");
_toolTipText.setDisplayName("toolTipText");
_toolTipText.setShortDescription("toolTipText");
PropertyDescriptor _fillColor = new PropertyDescriptor("fillColor",
beanClass, "getFillColor", "setFillColor");
_fillColor.setDisplayName("fillColor");
_fillColor.setShortDescription("fillColor");
_fillColor.setPropertyEditorClass(GeColorEditor.class);
PropertyDescriptor _borderColor = new PropertyDescriptor("borderColor",
beanClass, "getBorderColor", "setBorderColor");
_borderColor.setDisplayName("borderColor");
_borderColor.setShortDescription("borderColor");
_borderColor.setPropertyEditorClass(GeColorEditor.class);
PropertyDescriptor _colorTone = new PropertyDescriptor("colorTone",
beanClass, "getColorTone", "setColorTone");
_colorTone.setDisplayName("colorTone");
_colorTone.setShortDescription("colorTone");
_colorTone.setPropertyEditorClass(GeColorToneEditor.class);
PropertyDescriptor _colorShift = new PropertyDescriptor("colorShift",
beanClass, "getColorShift", "setColorShift");
_colorShift.setDisplayName("colorShift");
_colorShift.setShortDescription("colorShift");
_colorShift.setPropertyEditorClass(GeColorShiftEditor.class);
PropertyDescriptor _colorBrightness = new PropertyDescriptor("colorBrightness",
beanClass, "getColorBrightness", "setColorBrightness");
_colorBrightness.setDisplayName("colorBrightness");
_colorBrightness.setShortDescription("colorBrightness");
_colorBrightness.setPropertyEditorClass(GeColorBrightnessEditor.class);
PropertyDescriptor _colorIntensity = new PropertyDescriptor("colorIntensity",
beanClass, "getColorIntensity", "setColorIntensity");
_colorIntensity.setDisplayName("colorIntensity");
_colorIntensity.setShortDescription("colorIntensity");
_colorIntensity.setPropertyEditorClass(GeColorIntensityEditor.class);
PropertyDescriptor _rotate = new PropertyDescriptor("rotate",
beanClass, "getRotate", "setRotate");
_rotate.setDisplayName("rotate");
_rotate.setShortDescription("rotate");
PropertyDescriptor[] pds = new PropertyDescriptor[] {
_toolTipText, _fillColor, _borderColor, _colorTone, _colorShift,
_colorBrightness, _colorIntensity, _rotate};
return pds;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
public java.awt.Image getIcon(int iconKind) {
switch (iconKind) {
case BeanInfo.ICON_COLOR_16x16:
return iconColor16x16Filename != null ? loadImage(iconColor16x16Filename) : null;
case BeanInfo.ICON_COLOR_32x32:
return iconColor32x32Filename != null ? loadImage(iconColor32x32Filename) : null;
case BeanInfo.ICON_MONO_16x16:
return iconMono16x16Filename != null ? loadImage(iconMono16x16Filename) : null;
case BeanInfo.ICON_MONO_32x32:
return iconMono32x32Filename != null ? loadImage(iconMono32x32Filename) : null;
}
return null;
}
public BeanInfo[] getAdditionalBeanInfo() {
Class superclass = beanClass.getSuperclass();
try {
BeanInfo superBeanInfo = Introspector.getBeanInfo(superclass);
// return new BeanInfo[] { superBeanInfo };
return null;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* Proview $Id: JopImageBeanInfo.java,v 1.2 2005-09-01 14:57:49 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package jpwr.beans;
import jpwr.jop.*;
import java.beans.*;
public class JopImageBeanInfo extends SimpleBeanInfo {
Class beanClass = JopImage.class;
String iconColor16x16Filename = "jopimage16.gif";
String iconColor32x32Filename = "jopimage32.gif";
String iconMono16x16Filename;
String iconMono32x32Filename;
public JopImageBeanInfo() {
}
public PropertyDescriptor[] getPropertyDescriptors() {
try {
PropertyDescriptor _image = new PropertyDescriptor("image",
beanClass, "getImage", "setImage");
_image.setDisplayName("image");
_image.setShortDescription("image");
PropertyDescriptor _toolTipText = new PropertyDescriptor("toolTipText",
beanClass, "getToolTipText", "setToolTipText");
_toolTipText.setDisplayName("toolTipText");
_toolTipText.setShortDescription("toolTipText");
PropertyDescriptor[] pds = new PropertyDescriptor[] {
_image, _toolTipText};
return pds;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
public java.awt.Image getIcon(int iconKind) {
switch (iconKind) {
case BeanInfo.ICON_COLOR_16x16:
return iconColor16x16Filename != null ? loadImage(iconColor16x16Filename) : null;
case BeanInfo.ICON_COLOR_32x32:
return iconColor32x32Filename != null ? loadImage(iconColor32x32Filename) : null;
case BeanInfo.ICON_MONO_16x16:
return iconMono16x16Filename != null ? loadImage(iconMono16x16Filename) : null;
case BeanInfo.ICON_MONO_32x32:
return iconMono32x32Filename != null ? loadImage(iconMono32x32Filename) : null;
}
return null;
}
public BeanInfo[] getAdditionalBeanInfo() {
Class superclass = beanClass.getSuperclass();
try {
BeanInfo superBeanInfo = Introspector.getBeanInfo(superclass);
// return new BeanInfo[] { superBeanInfo };
return null;
}
catch(IntrospectionException ex) {
ex.printStackTrace();
return null;
}
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment