Commit eb4b2236 authored by claes's avatar claes

Dimmed and HostObject dynamics

parent 9e2fb5c7
...@@ -8,5 +8,8 @@ public class Ge { ...@@ -8,5 +8,8 @@ public class Ge {
public static final int DIRECTION_LEFT = 2; public static final int DIRECTION_LEFT = 2;
public static final int DIRECTION_UP = 3; public static final int DIRECTION_UP = 3;
public static final int DIRECTION_DOWN = 4; public static final int DIRECTION_DOWN = 4;
public static final int VISIBILITY_VISIBLE = 0;
public static final int VISIBILITY_INVISIBLE = 1;
public static final int VISIBILITY_DIMMED = 2;
public static final float cJBean_Offset = 2; public static final float cJBean_Offset = 2;
} }
...@@ -585,7 +585,7 @@ public class GeColor { ...@@ -585,7 +585,7 @@ public class GeColor {
public static int getDrawtype( int local_drawtype, int color_tone, int color_shift, public static int getDrawtype( int local_drawtype, int color_tone, int color_shift,
int color_intensity, int color_intensity,
int color_brightness, int color_inverse, int default_color) { int color_brightness, int color_inverse, int default_color, boolean dimmed) {
int drawtype; int drawtype;
int base_drawtype; int base_drawtype;
int incr; int incr;
...@@ -665,6 +665,18 @@ public class GeColor { ...@@ -665,6 +665,18 @@ public class GeColor {
if ( drawtype >= 10) if ( drawtype >= 10)
drawtype = drawtype + 10 - 2 * (drawtype % 10) - 1; drawtype = drawtype + 10 - 2 * (drawtype % 10) - 1;
} }
if ( dimmed) {
if ( drawtype == 0)
drawtype = 25;
else if ( 26 <= drawtype && drawtype <= 29)
drawtype = drawtype - 4;
else if ( 36 <= drawtype && drawtype <= 39)
drawtype = drawtype - 4;
else if ( 46 <= drawtype && drawtype <= 49)
drawtype = drawtype - 4;
else if ( 56 <= drawtype && drawtype <= 59)
drawtype = drawtype - 4;
}
if ( drawtype < 0 || drawtype >= 300) { if ( drawtype < 0 || drawtype >= 300) {
System.out.println("** Invalid drawtype"); System.out.println("** Invalid drawtype");
drawtype = 0; drawtype = 0;
...@@ -679,10 +691,10 @@ public class GeColor { ...@@ -679,10 +691,10 @@ public class GeColor {
} }
public static Color getColor( int local_drawtype, int color_tone, int color_shift, public static Color getColor( int local_drawtype, int color_tone, int color_shift,
int color_intensity, int color_intensity, int color_brightness, int color_inverse,
int color_brightness, int color_inverse, int default_color) { int default_color, boolean dimmed) {
int drawtype = getDrawtype( local_drawtype, color_tone, color_shift, color_intensity, int drawtype = getDrawtype( local_drawtype, color_tone, color_shift, color_intensity,
color_brightness, color_inverse, default_color); color_brightness, color_inverse, default_color, dimmed);
if ( colors[drawtype] == null) if ( colors[drawtype] == null)
colors[drawtype] = rgbColor( drawtype); colors[drawtype] = rgbColor( drawtype);
return colors[drawtype]; return colors[drawtype];
......
...@@ -52,6 +52,8 @@ public class GeComponent extends JComponent implements GeComponentIfc, ...@@ -52,6 +52,8 @@ public class GeComponent extends JComponent implements GeComponentIfc,
if ( dd.actionType != 0 && en.gdh.isAuthorized( dd.access)) { if ( dd.actionType != 0 && en.gdh.isAuthorized( dd.access)) {
this.addMouseListener(new MouseAdapter() { this.addMouseListener(new MouseAdapter() {
public void mouseReleased(MouseEvent e) { public void mouseReleased(MouseEvent e) {
if ( dimmed)
return;
if ( e.isPopupTrigger()) if ( e.isPopupTrigger())
dd.action( GeDyn.eEvent_MB3Press, e); dd.action( GeDyn.eEvent_MB3Press, e);
else if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 && else if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 &&
...@@ -60,6 +62,8 @@ public class GeComponent extends JComponent implements GeComponentIfc, ...@@ -60,6 +62,8 @@ public class GeComponent extends JComponent implements GeComponentIfc,
} }
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
if ( dimmed)
return;
if ( e.isPopupTrigger()) if ( e.isPopupTrigger())
dd.action( GeDyn.eEvent_MB3Press, e); dd.action( GeDyn.eEvent_MB3Press, e);
else if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 && else if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 &&
...@@ -67,6 +71,8 @@ public class GeComponent extends JComponent implements GeComponentIfc, ...@@ -67,6 +71,8 @@ public class GeComponent extends JComponent implements GeComponentIfc,
dd.action( GeDyn.eEvent_MB1Down, e); dd.action( GeDyn.eEvent_MB1Down, e);
} }
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
if ( dimmed)
return;
if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 && if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 &&
en.gdh.isAuthorized( dd.access)) en.gdh.isAuthorized( dd.access))
dd.action( GeDyn.eEvent_MB1Click, e); dd.action( GeDyn.eEvent_MB1Click, e);
...@@ -75,7 +81,7 @@ public class GeComponent extends JComponent implements GeComponentIfc, ...@@ -75,7 +81,7 @@ public class GeComponent extends JComponent implements GeComponentIfc,
if ( (dd.actionType & GeDyn.mActionType_Slider) != 0) { if ( (dd.actionType & GeDyn.mActionType_Slider) != 0) {
this.addMouseMotionListener( new MouseMotionAdapter() { this.addMouseMotionListener( new MouseMotionAdapter() {
public void mouseDragged(MouseEvent e) { public void mouseDragged(MouseEvent e) {
if ( actionDisabled) if ( actionDisabled || dimmed)
return; return;
if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 && if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 &&
en.gdh.isAuthorized( dd.access)) en.gdh.isAuthorized( dd.access))
...@@ -104,6 +110,24 @@ public class GeComponent extends JComponent implements GeComponentIfc, ...@@ -104,6 +110,24 @@ public class GeComponent extends JComponent implements GeComponentIfc,
public void resetColorTone() { colorTone = originalColorTone; } public void resetColorTone() { colorTone = originalColorTone; }
public void resetBorderColor() { borderColor = originalBorderColor;} public void resetBorderColor() { borderColor = originalBorderColor;}
public void resetTextColor() { textColor = originalTextColor;} public void resetTextColor() { textColor = originalTextColor;}
public void setVisibility( int visibility) {
switch ( visibility) {
case Ge.VISIBILITY_VISIBLE:
visible = true;
dimmed = false;
break;
case Ge.VISIBILITY_INVISIBLE:
visible = false;
dimmed = false;
repaint();
break;
case Ge.VISIBILITY_DIMMED:
visible = true;
dimmed = true;
repaint();
break;
}
}
public String getAnnot1() { return annot1;} public String getAnnot1() { return annot1;}
public void setAnnot1( String s) { annot1 = s;} public void setAnnot1( String s) { annot1 = s;}
public Object getDd() { return dd;} public Object getDd() { return dd;}
...@@ -139,6 +163,8 @@ public class GeComponent extends JComponent implements GeComponentIfc, ...@@ -139,6 +163,8 @@ public class GeComponent extends JComponent implements GeComponentIfc,
public int levelColorTone = 0; public int levelColorTone = 0;
public int levelFillColor = 0; public int levelFillColor = 0;
public int shadow = 0; public int shadow = 0;
public boolean visible = true;
public boolean dimmed = false;
public void setColorTone( int colorTone) { public void setColorTone( int colorTone) {
this.colorTone = colorTone; this.colorTone = colorTone;
originalColorTone = colorTone; originalColorTone = colorTone;
......
...@@ -15,6 +15,7 @@ public interface GeComponentIfc { ...@@ -15,6 +15,7 @@ public interface GeComponentIfc {
public void setLevelDirection( int levelDirection); public void setLevelDirection( int levelDirection);
public void setLevelColorTone( int levelColorTone); public void setLevelColorTone( int levelColorTone);
public void setLevelFillColor( int levelFillColor); public void setLevelFillColor( int levelFillColor);
public void setVisibility( int visibility);
public String getAnnot1(); public String getAnnot1();
public void setAnnot1( String annot1); public void setAnnot1( String annot1);
public void setLastPage(); public void setLastPage();
......
...@@ -30,6 +30,7 @@ public class GeDyn { ...@@ -30,6 +30,7 @@ public class GeDyn {
public static final int mDynType_AnalogText = 1 << 23; public static final int mDynType_AnalogText = 1 << 23;
public static final int mDynType_Table = 1 << 24; public static final int mDynType_Table = 1 << 24;
public static final int mDynType_StatusColor = 1 << 25; public static final int mDynType_StatusColor = 1 << 25;
public static final int mDynType_HostObject = 1 << 26;
public static final int mActionType_No = 0; public static final int mActionType_No = 0;
public static final int mActionType_Inherit = 1 << 0; public static final int mActionType_Inherit = 1 << 0;
...@@ -75,17 +76,16 @@ public class GeDyn { ...@@ -75,17 +76,16 @@ public class GeDyn {
public GeDynElemIfc[] elements; public GeDynElemIfc[] elements;
public GeComponentIfc comp; public GeComponentIfc comp;
public String instance; public String instance;
public String hostObject;
public boolean ignoreColor; public boolean ignoreColor;
public boolean resetColor; public boolean resetColor;
public boolean repaintNow; public boolean repaintNow;
public JopSession session; public JopSession session;
public JopEngine en; public JopEngine en;
public boolean invisible; public double rotate;
public boolean invisibleOld; public double x0;
public double rotate; public double y0;
public double x0;
public double y0;
public GeDyn( Object comp) { public GeDyn( Object comp) {
this.comp = (GeComponentIfc) comp; this.comp = (GeComponentIfc) comp;
...@@ -113,6 +113,9 @@ public class GeDyn { ...@@ -113,6 +113,9 @@ public class GeDyn {
public void setInstance( String instance) { public void setInstance( String instance) {
this.instance = instance; this.instance = instance;
} }
public void setHostObject( String hostObject) {
this.hostObject = hostObject;
}
public void setElements( GeDynElemIfc[] elements) { public void setElements( GeDynElemIfc[] elements) {
this.elements = elements; this.elements = elements;
} }
...@@ -161,11 +164,35 @@ public class GeDyn { ...@@ -161,11 +164,35 @@ public class GeDyn {
} }
public String getAttrName( String str) { public String getAttrName( String str) {
if ( str.toLowerCase().startsWith("$node")) {
int nix;
if ( instance == null)
nix = 0;
else {
CdhrObjid cdhr_inst = en.gdh.nameToObjid( instance);
nix = cdhr_inst.objid.vid;
}
CdhrObjid cdhr_node = en.gdh.getNodeObject(nix);
if ( cdhr_node.evenSts()) return str;
CdhrString cdhr_ns = en.gdh.objidToName( cdhr_node.objid, Cdh.mName_volumeStrict);
if ( cdhr_ns.evenSts()) return str;
String s = RtUtilities.strReplace( str, "$node", cdhr_ns.str);
return s;
}
if ( instance == null) { if ( instance == null) {
if ( str.startsWith("!")) if ( hostObject == null) {
return str.substring(1); if ( str.startsWith("!"))
else return str.substring(1);
return str; else
return str;
}
else {
String s = RtUtilities.strReplace( str, "$hostobject", hostObject);
if ( s.startsWith("!"))
return s.substring(1);
else
return s;
}
} }
else { else {
String s = RtUtilities.strReplace( str, "$object", instance); String s = RtUtilities.strReplace( str, "$object", instance);
...@@ -179,8 +206,12 @@ public class GeDyn { ...@@ -179,8 +206,12 @@ public class GeDyn {
public String getAttrNameNoSuffix( String str) { public String getAttrNameNoSuffix( String str) {
int startIdx; int startIdx;
String s; String s;
if ( instance == null) if ( instance == null) {
s = str; if ( hostObject == null)
s = str;
else
s = RtUtilities.strReplace( str, "$hostobject", hostObject);
}
else else
s = RtUtilities.strReplace( str, "$object", instance); s = RtUtilities.strReplace( str, "$object", instance);
......
package jpwr.jop;
import jpwr.rt.*;
public class GeDynHostObject extends GeDynElem {
public GeDynHostObject( GeDyn dyn, String hostObject) {
super( dyn, GeDyn.mDynType_HostObject, GeDyn.mActionType_No);
dyn.setHostObject( hostObject);
}
public void connect() {
}
public void disconnect() {
}
public void scan() {
}
}
...@@ -3,29 +3,42 @@ import jpwr.rt.*; ...@@ -3,29 +3,42 @@ import jpwr.rt.*;
public class GeDynInvisible extends GeDynElem { public class GeDynInvisible extends GeDynElem {
String attribute; String attribute;
int dimmed;
boolean attrFound; boolean attrFound;
PwrtRefId subid; PwrtRefId subid;
int typeId;
int p; int p;
boolean inverted; boolean inverted;
boolean oldValue; boolean oldValueB;
String oldValueS;
boolean firstScan = true; boolean firstScan = true;
boolean cmd = false;
boolean valueCmd = false;
public GeDynInvisible( GeDyn dyn, String attribute) { public GeDynInvisible( GeDyn dyn, String attribute, int dimmed) {
super( dyn, GeDyn.mDynType_Invisible, GeDyn.mActionType_No); super( dyn, GeDyn.mDynType_Invisible, GeDyn.mActionType_No);
this.attribute = attribute; this.attribute = attribute;
this.dimmed = dimmed;
} }
public void connect() { public void connect() {
String attrName = dyn.getAttrName( attribute); String attrName = dyn.getAttrName( attribute);
if ( attrName.compareTo("") != 0) { if ( attrName.compareTo("") != 0) {
GdhrRefObjectInfo ret = dyn.en.gdh.refObjectInfo( attrName); if ( attrName.toLowerCase().startsWith("$cmd(")) {
if ( ret.evenSts()) cmd = true;
System.out.println( "DigInvisible: " + attrName); valueCmd = false;
}
else { else {
attrFound = true; GdhrRefObjectInfo ret = dyn.en.gdh.refObjectInfo( attrName);
p = ret.id; if ( ret.evenSts())
subid = ret.refid; System.out.println( "DigInvisible: " + attrName);
inverted = GeDyndata.getAttrInverted( attribute); else {
attrFound = true;
p = ret.id;
subid = ret.refid;
typeId = ret.typeId;
inverted = GeDyndata.getAttrInverted( attribute);
}
} }
} }
} }
...@@ -34,26 +47,65 @@ public class GeDynInvisible extends GeDynElem { ...@@ -34,26 +47,65 @@ public class GeDynInvisible extends GeDynElem {
dyn.en.gdh.unrefObjectInfo( subid); dyn.en.gdh.unrefObjectInfo( subid);
} }
public void scan() { public void scan() {
if ( cmd) {
if ( firstScan) {
if ( dimmed == 0)
dyn.comp.setVisibility( Ge.VISIBILITY_INVISIBLE);
else
dyn.comp.setVisibility( Ge.VISIBILITY_DIMMED);
firstScan = false;
}
return;
}
if ( !attrFound) if ( !attrFound)
return; return;
boolean value = dyn.en.gdh.getObjectRefInfoBoolean( p); switch ( typeId) {
if ( !firstScan) { case Pwr.eType_Boolean: {
if ( value == oldValue) { boolean value = dyn.en.gdh.getObjectRefInfoBoolean( p);
// No change since last time if ( !firstScan) {
return; if ( value == oldValueB) {
// No change since last time
return;
}
} }
else
firstScan = false;
if ( (!inverted && value) || (inverted && !value)) {
if ( dimmed == 0)
dyn.comp.setVisibility( Ge.VISIBILITY_INVISIBLE);
else
dyn.comp.setVisibility( Ge.VISIBILITY_DIMMED);
}
else {
dyn.comp.setVisibility( Ge.VISIBILITY_VISIBLE);
}
dyn.repaintNow = true;
oldValueB = value;
break;
} }
else case Pwr.eType_String: {
firstScan = false; String value0;
value0 = dyn.en.gdh.getObjectRefInfoString( p, typeId);
if ( (!inverted && value) || (inverted && !value)) { if ( firstScan || value0.compareTo( oldValueS) != 0) {
dyn.invisible = true; if ( value0.compareTo("") == 0) {
if ( dimmed == 0)
dyn.comp.setVisibility( Ge.VISIBILITY_INVISIBLE);
else
dyn.comp.setVisibility( Ge.VISIBILITY_DIMMED);
}
else {
dyn.comp.setVisibility( Ge.VISIBILITY_VISIBLE);
}
dyn.repaintNow = true;
oldValueS = value0;
if ( firstScan)
firstScan = false;
}
break;
} }
else {
dyn.invisible = false;
} }
dyn.repaintNow = true;
oldValue = value;
} }
} }
......
...@@ -6,12 +6,24 @@ import javax.swing.*; ...@@ -6,12 +6,24 @@ import javax.swing.*;
public class GeDynTipText extends GeDynElem { public class GeDynTipText extends GeDynElem {
String text; String text;
boolean attrFound = false;
public GeDynTipText( GeDyn dyn, String text) { public GeDynTipText( GeDyn dyn, String text) {
super( dyn, GeDyn.mDynType_No, GeDyn.mActionType_TipText); super( dyn, GeDyn.mDynType_No, GeDyn.mActionType_TipText);
this.text = text; this.text = text;
} }
public void connect() { public void connect() {
((JComponent)dyn.comp).setToolTipText( text); if ( text.charAt(0) == '&') {
String attrName = dyn.getAttrName( text.substring(1));
CdhrString cdhr = dyn.en.gdh.getObjectInfoString( attrName);
if ( cdhr.evenSts()) return;
((JComponent)dyn.comp).setToolTipText( cdhr.str);
attrFound = true;
}
else
((JComponent)dyn.comp).setToolTipText( text);
} }
public void disconnect() { public void disconnect() {
} }
......
...@@ -92,19 +92,19 @@ public class GeFrameThin extends GeComponent { ...@@ -92,19 +92,19 @@ public class GeFrameThin extends GeComponent {
g.setStroke( new BasicStroke(1F)); g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(78, colorTone, g.setColor(GeColor.getColor(78, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor)); colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[0]); g.draw( shapes[0]);
g.setStroke( new BasicStroke(1F)); g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(78, colorTone, g.setColor(GeColor.getColor(78, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor)); colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[1]); g.draw( shapes[1]);
g.setStroke( new BasicStroke(1F)); g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(40, colorTone, g.setColor(GeColor.getColor(40, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor)); colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[2]); g.draw( shapes[2]);
g.setStroke( new BasicStroke(1F)); g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(40, colorTone, g.setColor(GeColor.getColor(40, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor)); colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[3]); g.draw( shapes[3]);
g.setTransform(save); g.setTransform(save);
} }
......
...@@ -206,7 +206,7 @@ public class GeTable extends JScrollPane implements GeComponentIfc, ...@@ -206,7 +206,7 @@ public class GeTable extends JScrollPane implements GeComponentIfc,
this.fillColor = fillColor; this.fillColor = fillColor;
normalColor = GeColor.getColor( fillColor, colorTone, normalColor = GeColor.getColor( fillColor, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor); colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false);
table.setBackground( normalColor); table.setBackground( normalColor);
if ( hColumn == 1) if ( hColumn == 1)
headerColumn.setBackground( normalColor); headerColumn.setBackground( normalColor);
...@@ -214,7 +214,7 @@ public class GeTable extends JScrollPane implements GeComponentIfc, ...@@ -214,7 +214,7 @@ public class GeTable extends JScrollPane implements GeComponentIfc,
public void tsetColorTone( int colorTone) { public void tsetColorTone( int colorTone) {
this.colorTone = colorTone; this.colorTone = colorTone;
normalColor = GeColor.getColor( fillColor, colorTone, normalColor = GeColor.getColor( fillColor, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, GeColor.NO_COLOR); colorShift, colorIntensity, colorBrightness, colorInverse, GeColor.NO_COLOR, false);
table.setBackground( normalColor); table.setBackground( normalColor);
if ( hColumn == 1) if ( hColumn == 1)
headerColumn.setBackground( normalColor); headerColumn.setBackground( normalColor);
...@@ -225,7 +225,7 @@ public class GeTable extends JScrollPane implements GeComponentIfc, ...@@ -225,7 +225,7 @@ public class GeTable extends JScrollPane implements GeComponentIfc,
public void resetFillColor() { public void resetFillColor() {
fillColor = originalFillColor; fillColor = originalFillColor;
normalColor = GeColor.getColor( fillColor, colorTone, normalColor = GeColor.getColor( fillColor, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor); colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false);
table.setBackground( normalColor); table.setBackground( normalColor);
if ( hColumn == 1) if ( hColumn == 1)
headerColumn.setBackground( normalColor); headerColumn.setBackground( normalColor);
...@@ -233,13 +233,14 @@ public class GeTable extends JScrollPane implements GeComponentIfc, ...@@ -233,13 +233,14 @@ public class GeTable extends JScrollPane implements GeComponentIfc,
public void resetColorTone() { public void resetColorTone() {
colorTone = originalColorTone; colorTone = originalColorTone;
normalColor = GeColor.getColor( fillColor, colorTone, normalColor = GeColor.getColor( fillColor, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor); colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false);
table.setBackground( normalColor); table.setBackground( normalColor);
if ( hColumn == 1) if ( hColumn == 1)
headerColumn.setBackground( normalColor); headerColumn.setBackground( normalColor);
} }
public void resetBorderColor() {} public void resetBorderColor() {}
public void resetTextColor() {} public void resetTextColor() {}
public void setVisibility( int visibility) {}
public String getAnnot1() { return "";} public String getAnnot1() { return "";}
public void setAnnot1( String s) {} public void setAnnot1( String s) {}
public void setLastPage() {} public void setLastPage() {}
...@@ -326,7 +327,7 @@ public class GeTable extends JScrollPane implements GeComponentIfc, ...@@ -326,7 +327,7 @@ public class GeTable extends JScrollPane implements GeComponentIfc,
dd.connect(); dd.connect();
normalColor = GeColor.getColor( fillColor, colorTone, normalColor = GeColor.getColor( fillColor, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor); colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false);
table.setBackground( normalColor); table.setBackground( normalColor);
if ( hColumn == 1) if ( hColumn == 1)
headerColumn.setBackground( normalColor); headerColumn.setBackground( normalColor);
......
...@@ -133,13 +133,13 @@ public class GeTextField extends JTextField implements GeComponentIfc, ...@@ -133,13 +133,13 @@ public class GeTextField extends JTextField implements GeComponentIfc,
this.fillColor = fillColor; this.fillColor = fillColor;
normalColor = GeColor.getColor( fillColor, colorTone, normalColor = GeColor.getColor( fillColor, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor); colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false);
setBackground( normalColor); setBackground( normalColor);
} }
public void tsetColorTone( int colorTone) { public void tsetColorTone( int colorTone) {
this.colorTone = colorTone; this.colorTone = colorTone;
normalColor = GeColor.getColor( fillColor, colorTone, normalColor = GeColor.getColor( fillColor, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, GeColor.NO_COLOR); colorShift, colorIntensity, colorBrightness, colorInverse, GeColor.NO_COLOR, false);
setBackground( normalColor); setBackground( normalColor);
} }
public void setShadow( int shadow) {} public void setShadow( int shadow) {}
...@@ -149,13 +149,13 @@ public class GeTextField extends JTextField implements GeComponentIfc, ...@@ -149,13 +149,13 @@ public class GeTextField extends JTextField implements GeComponentIfc,
public void resetFillColor() { public void resetFillColor() {
fillColor = originalFillColor; fillColor = originalFillColor;
normalColor = GeColor.getColor( fillColor, colorTone, normalColor = GeColor.getColor( fillColor, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor); colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false);
setBackground( normalColor); setBackground( normalColor);
} }
public void resetColorTone() { public void resetColorTone() {
colorTone = originalColorTone; colorTone = originalColorTone;
normalColor = GeColor.getColor( fillColor, colorTone, normalColor = GeColor.getColor( fillColor, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor); colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false);
setBackground( normalColor); setBackground( normalColor);
} }
public void resetBorderColor() {} public void resetBorderColor() {}
...@@ -176,6 +176,7 @@ public class GeTextField extends JTextField implements GeComponentIfc, ...@@ -176,6 +176,7 @@ public class GeTextField extends JTextField implements GeComponentIfc,
public void setLevelDirection( int levelDirection) {} public void setLevelDirection( int levelDirection) {}
public void setLevelColorTone( int levelColorTone) {} public void setLevelColorTone( int levelColorTone) {}
public void setLevelFillColor( int levelFillColor) {} public void setLevelFillColor( int levelFillColor) {}
public void setVisibility( int visibility) {}
Font annot1Font = new Font("Helvetica", Font.BOLD, 14); Font annot1Font = new Font("Helvetica", Font.BOLD, 14);
public Font annotFont = annot1Font; public Font annotFont = annot1Font;
...@@ -265,7 +266,7 @@ public class GeTextField extends JTextField implements GeComponentIfc, ...@@ -265,7 +266,7 @@ public class GeTextField extends JTextField implements GeComponentIfc,
dd.connect(); dd.connect();
normalColor = GeColor.getColor( fillColor, colorTone, normalColor = GeColor.getColor( fillColor, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor); colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false);
setBackground( normalColor); setBackground( normalColor);
} }
public void dynamicClose() { public void dynamicClose() {
......
...@@ -192,13 +192,13 @@ public class JopButtontoggle extends JComponent implements JopDynamic, ActionLis ...@@ -192,13 +192,13 @@ public class JopButtontoggle extends JComponent implements JopDynamic, ActionLis
Math.PI * rotate/180,((double)original_width)/2, ((double)original_height)/2)); Math.PI * rotate/180,((double)original_width)/2, ((double)original_height)/2));
g.transform( AffineTransform.getScaleInstance( scaleWidth, scaleHeight)); g.transform( AffineTransform.getScaleInstance( scaleWidth, scaleHeight));
g.setColor(GeColor.getColor(22, colorTone, g.setColor(GeColor.getColor(22, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor)); colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false));
g.fill( shapes[0]); g.fill( shapes[0]);
g.setColor(GeColor.getColor(20, colorTone, g.setColor(GeColor.getColor(20, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor)); colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false));
g.fill( shapes[1]); g.fill( shapes[1]);
g.setColor(GeColor.getColor(23, colorTone, g.setColor(GeColor.getColor(23, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor)); colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false));
g.fill( shapes[2]); g.fill( shapes[2]);
g.setStroke( new BasicStroke(1F)); g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, borderColor)); g.setColor(GeColor.getColor(0, borderColor));
......
...@@ -141,7 +141,7 @@ public class JopFilter extends JComponent implements JopDynamic, ActionListener{ ...@@ -141,7 +141,7 @@ public class JopFilter extends JComponent implements JopDynamic, ActionListener{
Math.PI * rotate/180,((double)original_width)/2, ((double)original_height)/2)); Math.PI * rotate/180,((double)original_width)/2, ((double)original_height)/2));
g.transform( AffineTransform.getScaleInstance( scaleWidth, scaleHeight)); g.transform( AffineTransform.getScaleInstance( scaleWidth, scaleHeight));
g.setColor(GeColor.getColor(21, colorTone, g.setColor(GeColor.getColor(21, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor)); colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false));
g.fill( shapes[0]); g.fill( shapes[0]);
g.setStroke( new BasicStroke(1F)); g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, borderColor)); g.setColor(GeColor.getColor(0, borderColor));
......
...@@ -140,7 +140,7 @@ System.out.println( "qcom put finished"); ...@@ -140,7 +140,7 @@ System.out.println( "qcom put finished");
// Replace * by node object // Replace * by node object
if ( objectValue.charAt(0) == '*') { if ( objectValue.charAt(0) == '*') {
CdhrObjid cdhr_node = gdh.getNodeObject(); CdhrObjid cdhr_node = gdh.getNodeObject(0);
if ( cdhr_node.evenSts()) if ( cdhr_node.evenSts())
return; return;
CdhrString cdhr_nodestr = gdh.objidToName( cdhr_node.objid, Cdh.mName_volumeStrict); CdhrString cdhr_nodestr = gdh.objidToName( cdhr_node.objid, Cdh.mName_volumeStrict);
......
...@@ -8,5 +8,8 @@ public class Ge { ...@@ -8,5 +8,8 @@ public class Ge {
public static final int DIRECTION_LEFT = 2; public static final int DIRECTION_LEFT = 2;
public static final int DIRECTION_UP = 3; public static final int DIRECTION_UP = 3;
public static final int DIRECTION_DOWN = 4; public static final int DIRECTION_DOWN = 4;
public static final int VISIBILITY_VISIBLE = 0;
public static final int VISIBILITY_INVISIBLE = 1;
public static final int VISIBILITY_DIMMED = 2;
public static final float cJBean_Offset = 2; public static final float cJBean_Offset = 2;
} }
...@@ -585,7 +585,7 @@ public class GeColor { ...@@ -585,7 +585,7 @@ public class GeColor {
public static int getDrawtype( int local_drawtype, int color_tone, int color_shift, public static int getDrawtype( int local_drawtype, int color_tone, int color_shift,
int color_intensity, int color_intensity,
int color_brightness, int color_inverse, int default_color) { int color_brightness, int color_inverse, int default_color, boolean dimmed) {
int drawtype; int drawtype;
int base_drawtype; int base_drawtype;
int incr; int incr;
...@@ -665,6 +665,18 @@ public class GeColor { ...@@ -665,6 +665,18 @@ public class GeColor {
if ( drawtype >= 10) if ( drawtype >= 10)
drawtype = drawtype + 10 - 2 * (drawtype % 10) - 1; drawtype = drawtype + 10 - 2 * (drawtype % 10) - 1;
} }
if ( dimmed) {
if ( drawtype == 0)
drawtype = 25;
else if ( 26 <= drawtype && drawtype <= 29)
drawtype = drawtype - 4;
else if ( 36 <= drawtype && drawtype <= 39)
drawtype = drawtype - 4;
else if ( 46 <= drawtype && drawtype <= 49)
drawtype = drawtype - 4;
else if ( 56 <= drawtype && drawtype <= 59)
drawtype = drawtype - 4;
}
if ( drawtype < 0 || drawtype >= 300) { if ( drawtype < 0 || drawtype >= 300) {
System.out.println("** Invalid drawtype"); System.out.println("** Invalid drawtype");
drawtype = 0; drawtype = 0;
...@@ -679,10 +691,10 @@ public class GeColor { ...@@ -679,10 +691,10 @@ public class GeColor {
} }
public static Color getColor( int local_drawtype, int color_tone, int color_shift, public static Color getColor( int local_drawtype, int color_tone, int color_shift,
int color_intensity, int color_intensity, int color_brightness, int color_inverse,
int color_brightness, int color_inverse, int default_color) { int default_color, boolean dimmed) {
int drawtype = getDrawtype( local_drawtype, color_tone, color_shift, color_intensity, int drawtype = getDrawtype( local_drawtype, color_tone, color_shift, color_intensity,
color_brightness, color_inverse, default_color); color_brightness, color_inverse, default_color, dimmed);
if ( colors[drawtype] == null) if ( colors[drawtype] == null)
colors[drawtype] = rgbColor( drawtype); colors[drawtype] = rgbColor( drawtype);
return colors[drawtype]; return colors[drawtype];
......
...@@ -52,6 +52,8 @@ public class GeComponent extends JComponent implements GeComponentIfc, ...@@ -52,6 +52,8 @@ public class GeComponent extends JComponent implements GeComponentIfc,
if ( dd.actionType != 0 && en.gdh.isAuthorized( dd.access)) { if ( dd.actionType != 0 && en.gdh.isAuthorized( dd.access)) {
this.addMouseListener(new MouseAdapter() { this.addMouseListener(new MouseAdapter() {
public void mouseReleased(MouseEvent e) { public void mouseReleased(MouseEvent e) {
if ( dimmed)
return;
if ( e.isPopupTrigger()) if ( e.isPopupTrigger())
dd.action( GeDyn.eEvent_MB3Press, e); dd.action( GeDyn.eEvent_MB3Press, e);
else if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 && else if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 &&
...@@ -60,6 +62,8 @@ public class GeComponent extends JComponent implements GeComponentIfc, ...@@ -60,6 +62,8 @@ public class GeComponent extends JComponent implements GeComponentIfc,
} }
public void mousePressed(MouseEvent e) { public void mousePressed(MouseEvent e) {
if ( dimmed)
return;
if ( e.isPopupTrigger()) if ( e.isPopupTrigger())
dd.action( GeDyn.eEvent_MB3Press, e); dd.action( GeDyn.eEvent_MB3Press, e);
else if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 && else if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 &&
...@@ -67,6 +71,8 @@ public class GeComponent extends JComponent implements GeComponentIfc, ...@@ -67,6 +71,8 @@ public class GeComponent extends JComponent implements GeComponentIfc,
dd.action( GeDyn.eEvent_MB1Down, e); dd.action( GeDyn.eEvent_MB1Down, e);
} }
public void mouseClicked(MouseEvent e) { public void mouseClicked(MouseEvent e) {
if ( dimmed)
return;
if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 && if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 &&
en.gdh.isAuthorized( dd.access)) en.gdh.isAuthorized( dd.access))
dd.action( GeDyn.eEvent_MB1Click, e); dd.action( GeDyn.eEvent_MB1Click, e);
...@@ -75,7 +81,7 @@ public class GeComponent extends JComponent implements GeComponentIfc, ...@@ -75,7 +81,7 @@ public class GeComponent extends JComponent implements GeComponentIfc,
if ( (dd.actionType & GeDyn.mActionType_Slider) != 0) { if ( (dd.actionType & GeDyn.mActionType_Slider) != 0) {
this.addMouseMotionListener( new MouseMotionAdapter() { this.addMouseMotionListener( new MouseMotionAdapter() {
public void mouseDragged(MouseEvent e) { public void mouseDragged(MouseEvent e) {
if ( actionDisabled) if ( actionDisabled || dimmed)
return; return;
if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 && if ((e.getModifiers() & MouseEvent.BUTTON1_MASK) != 0 &&
en.gdh.isAuthorized( dd.access)) en.gdh.isAuthorized( dd.access))
...@@ -104,6 +110,24 @@ public class GeComponent extends JComponent implements GeComponentIfc, ...@@ -104,6 +110,24 @@ public class GeComponent extends JComponent implements GeComponentIfc,
public void resetColorTone() { colorTone = originalColorTone; } public void resetColorTone() { colorTone = originalColorTone; }
public void resetBorderColor() { borderColor = originalBorderColor;} public void resetBorderColor() { borderColor = originalBorderColor;}
public void resetTextColor() { textColor = originalTextColor;} public void resetTextColor() { textColor = originalTextColor;}
public void setVisibility( int visibility) {
switch ( visibility) {
case Ge.VISIBILITY_VISIBLE:
visible = true;
dimmed = false;
break;
case Ge.VISIBILITY_INVISIBLE:
visible = false;
dimmed = false;
repaint();
break;
case Ge.VISIBILITY_DIMMED:
visible = true;
dimmed = true;
repaint();
break;
}
}
public String getAnnot1() { return annot1;} public String getAnnot1() { return annot1;}
public void setAnnot1( String s) { annot1 = s;} public void setAnnot1( String s) { annot1 = s;}
public Object getDd() { return dd;} public Object getDd() { return dd;}
...@@ -139,6 +163,8 @@ public class GeComponent extends JComponent implements GeComponentIfc, ...@@ -139,6 +163,8 @@ public class GeComponent extends JComponent implements GeComponentIfc,
public int levelColorTone = 0; public int levelColorTone = 0;
public int levelFillColor = 0; public int levelFillColor = 0;
public int shadow = 0; public int shadow = 0;
public boolean visible = true;
public boolean dimmed = false;
public void setColorTone( int colorTone) { public void setColorTone( int colorTone) {
this.colorTone = colorTone; this.colorTone = colorTone;
originalColorTone = colorTone; originalColorTone = colorTone;
......
...@@ -15,6 +15,7 @@ public interface GeComponentIfc { ...@@ -15,6 +15,7 @@ public interface GeComponentIfc {
public void setLevelDirection( int levelDirection); public void setLevelDirection( int levelDirection);
public void setLevelColorTone( int levelColorTone); public void setLevelColorTone( int levelColorTone);
public void setLevelFillColor( int levelFillColor); public void setLevelFillColor( int levelFillColor);
public void setVisibility( int visibility);
public String getAnnot1(); public String getAnnot1();
public void setAnnot1( String annot1); public void setAnnot1( String annot1);
public void setLastPage(); public void setLastPage();
......
...@@ -30,6 +30,7 @@ public class GeDyn { ...@@ -30,6 +30,7 @@ public class GeDyn {
public static final int mDynType_AnalogText = 1 << 23; public static final int mDynType_AnalogText = 1 << 23;
public static final int mDynType_Table = 1 << 24; public static final int mDynType_Table = 1 << 24;
public static final int mDynType_StatusColor = 1 << 25; public static final int mDynType_StatusColor = 1 << 25;
public static final int mDynType_HostObject = 1 << 26;
public static final int mActionType_No = 0; public static final int mActionType_No = 0;
public static final int mActionType_Inherit = 1 << 0; public static final int mActionType_Inherit = 1 << 0;
...@@ -75,17 +76,16 @@ public class GeDyn { ...@@ -75,17 +76,16 @@ public class GeDyn {
public GeDynElemIfc[] elements; public GeDynElemIfc[] elements;
public GeComponentIfc comp; public GeComponentIfc comp;
public String instance; public String instance;
public String hostObject;
public boolean ignoreColor; public boolean ignoreColor;
public boolean resetColor; public boolean resetColor;
public boolean repaintNow; public boolean repaintNow;
public JopSession session; public JopSession session;
public JopEngine en; public JopEngine en;
public boolean invisible; public double rotate;
public boolean invisibleOld; public double x0;
public double rotate; public double y0;
public double x0;
public double y0;
public GeDyn( Object comp) { public GeDyn( Object comp) {
this.comp = (GeComponentIfc) comp; this.comp = (GeComponentIfc) comp;
...@@ -113,6 +113,9 @@ public class GeDyn { ...@@ -113,6 +113,9 @@ public class GeDyn {
public void setInstance( String instance) { public void setInstance( String instance) {
this.instance = instance; this.instance = instance;
} }
public void setHostObject( String hostObject) {
this.hostObject = hostObject;
}
public void setElements( GeDynElemIfc[] elements) { public void setElements( GeDynElemIfc[] elements) {
this.elements = elements; this.elements = elements;
} }
...@@ -161,11 +164,35 @@ public class GeDyn { ...@@ -161,11 +164,35 @@ public class GeDyn {
} }
public String getAttrName( String str) { public String getAttrName( String str) {
if ( str.toLowerCase().startsWith("$node")) {
int nix;
if ( instance == null)
nix = 0;
else {
CdhrObjid cdhr_inst = en.gdh.nameToObjid( instance);
nix = cdhr_inst.objid.vid;
}
CdhrObjid cdhr_node = en.gdh.getNodeObject(nix);
if ( cdhr_node.evenSts()) return str;
CdhrString cdhr_ns = en.gdh.objidToName( cdhr_node.objid, Cdh.mName_volumeStrict);
if ( cdhr_ns.evenSts()) return str;
String s = RtUtilities.strReplace( str, "$node", cdhr_ns.str);
return s;
}
if ( instance == null) { if ( instance == null) {
if ( str.startsWith("!")) if ( hostObject == null) {
return str.substring(1); if ( str.startsWith("!"))
else return str.substring(1);
return str; else
return str;
}
else {
String s = RtUtilities.strReplace( str, "$hostobject", hostObject);
if ( s.startsWith("!"))
return s.substring(1);
else
return s;
}
} }
else { else {
String s = RtUtilities.strReplace( str, "$object", instance); String s = RtUtilities.strReplace( str, "$object", instance);
...@@ -179,8 +206,12 @@ public class GeDyn { ...@@ -179,8 +206,12 @@ public class GeDyn {
public String getAttrNameNoSuffix( String str) { public String getAttrNameNoSuffix( String str) {
int startIdx; int startIdx;
String s; String s;
if ( instance == null) if ( instance == null) {
s = str; if ( hostObject == null)
s = str;
else
s = RtUtilities.strReplace( str, "$hostobject", hostObject);
}
else else
s = RtUtilities.strReplace( str, "$object", instance); s = RtUtilities.strReplace( str, "$object", instance);
......
package jpwr.jop;
import jpwr.rt.*;
public class GeDynHostObject extends GeDynElem {
public GeDynHostObject( GeDyn dyn, String hostObject) {
super( dyn, GeDyn.mDynType_HostObject, GeDyn.mActionType_No);
dyn.setHostObject( hostObject);
}
public void connect() {
}
public void disconnect() {
}
public void scan() {
}
}
...@@ -3,29 +3,42 @@ import jpwr.rt.*; ...@@ -3,29 +3,42 @@ import jpwr.rt.*;
public class GeDynInvisible extends GeDynElem { public class GeDynInvisible extends GeDynElem {
String attribute; String attribute;
int dimmed;
boolean attrFound; boolean attrFound;
PwrtRefId subid; PwrtRefId subid;
int typeId;
int p; int p;
boolean inverted; boolean inverted;
boolean oldValue; boolean oldValueB;
String oldValueS;
boolean firstScan = true; boolean firstScan = true;
boolean cmd = false;
boolean valueCmd = false;
public GeDynInvisible( GeDyn dyn, String attribute) { public GeDynInvisible( GeDyn dyn, String attribute, int dimmed) {
super( dyn, GeDyn.mDynType_Invisible, GeDyn.mActionType_No); super( dyn, GeDyn.mDynType_Invisible, GeDyn.mActionType_No);
this.attribute = attribute; this.attribute = attribute;
this.dimmed = dimmed;
} }
public void connect() { public void connect() {
String attrName = dyn.getAttrName( attribute); String attrName = dyn.getAttrName( attribute);
if ( attrName.compareTo("") != 0) { if ( attrName.compareTo("") != 0) {
GdhrRefObjectInfo ret = dyn.en.gdh.refObjectInfo( attrName); if ( attrName.toLowerCase().startsWith("$cmd(")) {
if ( ret.evenSts()) cmd = true;
System.out.println( "DigInvisible: " + attrName); valueCmd = false;
}
else { else {
attrFound = true; GdhrRefObjectInfo ret = dyn.en.gdh.refObjectInfo( attrName);
p = ret.id; if ( ret.evenSts())
subid = ret.refid; System.out.println( "DigInvisible: " + attrName);
inverted = GeDyndata.getAttrInverted( attribute); else {
attrFound = true;
p = ret.id;
subid = ret.refid;
typeId = ret.typeId;
inverted = GeDyndata.getAttrInverted( attribute);
}
} }
} }
} }
...@@ -34,26 +47,65 @@ public class GeDynInvisible extends GeDynElem { ...@@ -34,26 +47,65 @@ public class GeDynInvisible extends GeDynElem {
dyn.en.gdh.unrefObjectInfo( subid); dyn.en.gdh.unrefObjectInfo( subid);
} }
public void scan() { public void scan() {
if ( cmd) {
if ( firstScan) {
if ( dimmed == 0)
dyn.comp.setVisibility( Ge.VISIBILITY_INVISIBLE);
else
dyn.comp.setVisibility( Ge.VISIBILITY_DIMMED);
firstScan = false;
}
return;
}
if ( !attrFound) if ( !attrFound)
return; return;
boolean value = dyn.en.gdh.getObjectRefInfoBoolean( p); switch ( typeId) {
if ( !firstScan) { case Pwr.eType_Boolean: {
if ( value == oldValue) { boolean value = dyn.en.gdh.getObjectRefInfoBoolean( p);
// No change since last time if ( !firstScan) {
return; if ( value == oldValueB) {
// No change since last time
return;
}
} }
else
firstScan = false;
if ( (!inverted && value) || (inverted && !value)) {
if ( dimmed == 0)
dyn.comp.setVisibility( Ge.VISIBILITY_INVISIBLE);
else
dyn.comp.setVisibility( Ge.VISIBILITY_DIMMED);
}
else {
dyn.comp.setVisibility( Ge.VISIBILITY_VISIBLE);
}
dyn.repaintNow = true;
oldValueB = value;
break;
} }
else case Pwr.eType_String: {
firstScan = false; String value0;
value0 = dyn.en.gdh.getObjectRefInfoString( p, typeId);
if ( (!inverted && value) || (inverted && !value)) { if ( firstScan || value0.compareTo( oldValueS) != 0) {
dyn.invisible = true; if ( value0.compareTo("") == 0) {
if ( dimmed == 0)
dyn.comp.setVisibility( Ge.VISIBILITY_INVISIBLE);
else
dyn.comp.setVisibility( Ge.VISIBILITY_DIMMED);
}
else {
dyn.comp.setVisibility( Ge.VISIBILITY_VISIBLE);
}
dyn.repaintNow = true;
oldValueS = value0;
if ( firstScan)
firstScan = false;
}
break;
} }
else {
dyn.invisible = false;
} }
dyn.repaintNow = true;
oldValue = value;
} }
} }
......
...@@ -6,12 +6,24 @@ import javax.swing.*; ...@@ -6,12 +6,24 @@ import javax.swing.*;
public class GeDynTipText extends GeDynElem { public class GeDynTipText extends GeDynElem {
String text; String text;
boolean attrFound = false;
public GeDynTipText( GeDyn dyn, String text) { public GeDynTipText( GeDyn dyn, String text) {
super( dyn, GeDyn.mDynType_No, GeDyn.mActionType_TipText); super( dyn, GeDyn.mDynType_No, GeDyn.mActionType_TipText);
this.text = text; this.text = text;
} }
public void connect() { public void connect() {
((JComponent)dyn.comp).setToolTipText( text); if ( text.charAt(0) == '&') {
String attrName = dyn.getAttrName( text.substring(1));
CdhrString cdhr = dyn.en.gdh.getObjectInfoString( attrName);
if ( cdhr.evenSts()) return;
((JComponent)dyn.comp).setToolTipText( cdhr.str);
attrFound = true;
}
else
((JComponent)dyn.comp).setToolTipText( text);
} }
public void disconnect() { public void disconnect() {
} }
......
...@@ -92,19 +92,19 @@ public class GeFrameThin extends GeComponent { ...@@ -92,19 +92,19 @@ public class GeFrameThin extends GeComponent {
g.setStroke( new BasicStroke(1F)); g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(78, colorTone, g.setColor(GeColor.getColor(78, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor)); colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[0]); g.draw( shapes[0]);
g.setStroke( new BasicStroke(1F)); g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(78, colorTone, g.setColor(GeColor.getColor(78, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor)); colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[1]); g.draw( shapes[1]);
g.setStroke( new BasicStroke(1F)); g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(40, colorTone, g.setColor(GeColor.getColor(40, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor)); colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[2]); g.draw( shapes[2]);
g.setStroke( new BasicStroke(1F)); g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(40, colorTone, g.setColor(GeColor.getColor(40, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, borderColor)); colorShift, colorIntensity, colorBrightness, colorInverse, borderColor, false));
g.draw( shapes[3]); g.draw( shapes[3]);
g.setTransform(save); g.setTransform(save);
} }
......
...@@ -206,7 +206,7 @@ public class GeTable extends JScrollPane implements GeComponentIfc, ...@@ -206,7 +206,7 @@ public class GeTable extends JScrollPane implements GeComponentIfc,
this.fillColor = fillColor; this.fillColor = fillColor;
normalColor = GeColor.getColor( fillColor, colorTone, normalColor = GeColor.getColor( fillColor, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor); colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false);
table.setBackground( normalColor); table.setBackground( normalColor);
if ( hColumn == 1) if ( hColumn == 1)
headerColumn.setBackground( normalColor); headerColumn.setBackground( normalColor);
...@@ -214,7 +214,7 @@ public class GeTable extends JScrollPane implements GeComponentIfc, ...@@ -214,7 +214,7 @@ public class GeTable extends JScrollPane implements GeComponentIfc,
public void tsetColorTone( int colorTone) { public void tsetColorTone( int colorTone) {
this.colorTone = colorTone; this.colorTone = colorTone;
normalColor = GeColor.getColor( fillColor, colorTone, normalColor = GeColor.getColor( fillColor, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, GeColor.NO_COLOR); colorShift, colorIntensity, colorBrightness, colorInverse, GeColor.NO_COLOR, false);
table.setBackground( normalColor); table.setBackground( normalColor);
if ( hColumn == 1) if ( hColumn == 1)
headerColumn.setBackground( normalColor); headerColumn.setBackground( normalColor);
...@@ -225,7 +225,7 @@ public class GeTable extends JScrollPane implements GeComponentIfc, ...@@ -225,7 +225,7 @@ public class GeTable extends JScrollPane implements GeComponentIfc,
public void resetFillColor() { public void resetFillColor() {
fillColor = originalFillColor; fillColor = originalFillColor;
normalColor = GeColor.getColor( fillColor, colorTone, normalColor = GeColor.getColor( fillColor, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor); colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false);
table.setBackground( normalColor); table.setBackground( normalColor);
if ( hColumn == 1) if ( hColumn == 1)
headerColumn.setBackground( normalColor); headerColumn.setBackground( normalColor);
...@@ -233,13 +233,14 @@ public class GeTable extends JScrollPane implements GeComponentIfc, ...@@ -233,13 +233,14 @@ public class GeTable extends JScrollPane implements GeComponentIfc,
public void resetColorTone() { public void resetColorTone() {
colorTone = originalColorTone; colorTone = originalColorTone;
normalColor = GeColor.getColor( fillColor, colorTone, normalColor = GeColor.getColor( fillColor, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor); colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false);
table.setBackground( normalColor); table.setBackground( normalColor);
if ( hColumn == 1) if ( hColumn == 1)
headerColumn.setBackground( normalColor); headerColumn.setBackground( normalColor);
} }
public void resetBorderColor() {} public void resetBorderColor() {}
public void resetTextColor() {} public void resetTextColor() {}
public void setVisibility( int visibility) {}
public String getAnnot1() { return "";} public String getAnnot1() { return "";}
public void setAnnot1( String s) {} public void setAnnot1( String s) {}
public void setLastPage() {} public void setLastPage() {}
...@@ -326,7 +327,7 @@ public class GeTable extends JScrollPane implements GeComponentIfc, ...@@ -326,7 +327,7 @@ public class GeTable extends JScrollPane implements GeComponentIfc,
dd.connect(); dd.connect();
normalColor = GeColor.getColor( fillColor, colorTone, normalColor = GeColor.getColor( fillColor, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor); colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false);
table.setBackground( normalColor); table.setBackground( normalColor);
if ( hColumn == 1) if ( hColumn == 1)
headerColumn.setBackground( normalColor); headerColumn.setBackground( normalColor);
......
...@@ -133,13 +133,13 @@ public class GeTextField extends JTextField implements GeComponentIfc, ...@@ -133,13 +133,13 @@ public class GeTextField extends JTextField implements GeComponentIfc,
this.fillColor = fillColor; this.fillColor = fillColor;
normalColor = GeColor.getColor( fillColor, colorTone, normalColor = GeColor.getColor( fillColor, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor); colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false);
setBackground( normalColor); setBackground( normalColor);
} }
public void tsetColorTone( int colorTone) { public void tsetColorTone( int colorTone) {
this.colorTone = colorTone; this.colorTone = colorTone;
normalColor = GeColor.getColor( fillColor, colorTone, normalColor = GeColor.getColor( fillColor, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, GeColor.NO_COLOR); colorShift, colorIntensity, colorBrightness, colorInverse, GeColor.NO_COLOR, false);
setBackground( normalColor); setBackground( normalColor);
} }
public void setShadow( int shadow) {} public void setShadow( int shadow) {}
...@@ -149,13 +149,13 @@ public class GeTextField extends JTextField implements GeComponentIfc, ...@@ -149,13 +149,13 @@ public class GeTextField extends JTextField implements GeComponentIfc,
public void resetFillColor() { public void resetFillColor() {
fillColor = originalFillColor; fillColor = originalFillColor;
normalColor = GeColor.getColor( fillColor, colorTone, normalColor = GeColor.getColor( fillColor, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor); colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false);
setBackground( normalColor); setBackground( normalColor);
} }
public void resetColorTone() { public void resetColorTone() {
colorTone = originalColorTone; colorTone = originalColorTone;
normalColor = GeColor.getColor( fillColor, colorTone, normalColor = GeColor.getColor( fillColor, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor); colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false);
setBackground( normalColor); setBackground( normalColor);
} }
public void resetBorderColor() {} public void resetBorderColor() {}
...@@ -176,6 +176,7 @@ public class GeTextField extends JTextField implements GeComponentIfc, ...@@ -176,6 +176,7 @@ public class GeTextField extends JTextField implements GeComponentIfc,
public void setLevelDirection( int levelDirection) {} public void setLevelDirection( int levelDirection) {}
public void setLevelColorTone( int levelColorTone) {} public void setLevelColorTone( int levelColorTone) {}
public void setLevelFillColor( int levelFillColor) {} public void setLevelFillColor( int levelFillColor) {}
public void setVisibility( int visibility) {}
Font annot1Font = new Font("Helvetica", Font.BOLD, 14); Font annot1Font = new Font("Helvetica", Font.BOLD, 14);
public Font annotFont = annot1Font; public Font annotFont = annot1Font;
...@@ -265,7 +266,7 @@ public class GeTextField extends JTextField implements GeComponentIfc, ...@@ -265,7 +266,7 @@ public class GeTextField extends JTextField implements GeComponentIfc,
dd.connect(); dd.connect();
normalColor = GeColor.getColor( fillColor, colorTone, normalColor = GeColor.getColor( fillColor, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor); colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false);
setBackground( normalColor); setBackground( normalColor);
} }
public void dynamicClose() { public void dynamicClose() {
......
...@@ -192,13 +192,13 @@ public class JopButtontoggle extends JComponent implements JopDynamic, ActionLis ...@@ -192,13 +192,13 @@ public class JopButtontoggle extends JComponent implements JopDynamic, ActionLis
Math.PI * rotate/180,((double)original_width)/2, ((double)original_height)/2)); Math.PI * rotate/180,((double)original_width)/2, ((double)original_height)/2));
g.transform( AffineTransform.getScaleInstance( scaleWidth, scaleHeight)); g.transform( AffineTransform.getScaleInstance( scaleWidth, scaleHeight));
g.setColor(GeColor.getColor(22, colorTone, g.setColor(GeColor.getColor(22, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor)); colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false));
g.fill( shapes[0]); g.fill( shapes[0]);
g.setColor(GeColor.getColor(20, colorTone, g.setColor(GeColor.getColor(20, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor)); colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false));
g.fill( shapes[1]); g.fill( shapes[1]);
g.setColor(GeColor.getColor(23, colorTone, g.setColor(GeColor.getColor(23, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor)); colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false));
g.fill( shapes[2]); g.fill( shapes[2]);
g.setStroke( new BasicStroke(1F)); g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, borderColor)); g.setColor(GeColor.getColor(0, borderColor));
......
...@@ -141,7 +141,7 @@ public class JopFilter extends JComponent implements JopDynamic, ActionListener{ ...@@ -141,7 +141,7 @@ public class JopFilter extends JComponent implements JopDynamic, ActionListener{
Math.PI * rotate/180,((double)original_width)/2, ((double)original_height)/2)); Math.PI * rotate/180,((double)original_width)/2, ((double)original_height)/2));
g.transform( AffineTransform.getScaleInstance( scaleWidth, scaleHeight)); g.transform( AffineTransform.getScaleInstance( scaleWidth, scaleHeight));
g.setColor(GeColor.getColor(21, colorTone, g.setColor(GeColor.getColor(21, colorTone,
colorShift, colorIntensity, colorBrightness, colorInverse, fillColor)); colorShift, colorIntensity, colorBrightness, colorInverse, fillColor, false));
g.fill( shapes[0]); g.fill( shapes[0]);
g.setStroke( new BasicStroke(1F)); g.setStroke( new BasicStroke(1F));
g.setColor(GeColor.getColor(0, borderColor)); g.setColor(GeColor.getColor(0, borderColor));
......
...@@ -140,7 +140,7 @@ System.out.println( "qcom put finished"); ...@@ -140,7 +140,7 @@ System.out.println( "qcom put finished");
// Replace * by node object // Replace * by node object
if ( objectValue.charAt(0) == '*') { if ( objectValue.charAt(0) == '*') {
CdhrObjid cdhr_node = gdh.getNodeObject(); CdhrObjid cdhr_node = gdh.getNodeObject(0);
if ( cdhr_node.evenSts()) if ( cdhr_node.evenSts())
return; return;
CdhrString cdhr_nodestr = gdh.objidToName( cdhr_node.objid, Cdh.mName_volumeStrict); CdhrString cdhr_nodestr = gdh.objidToName( cdhr_node.objid, Cdh.mName_volumeStrict);
......
...@@ -64,6 +64,7 @@ local_java_sources := \ ...@@ -64,6 +64,7 @@ local_java_sources := \
GeDynOptionMenu.java \ GeDynOptionMenu.java \
GeDynAnalogText.java \ GeDynAnalogText.java \
GeDynTable.java \ GeDynTable.java \
GeDynHostObject.java \
Proportion.java\ Proportion.java\
RatioLayout.java \ RatioLayout.java \
AspectRatioListener.java \ AspectRatioListener.java \
......
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