Commit aee83ace authored by claes's avatar claes

Attributes for minvalue, maxvalue and insensitivity

parent 302d4689
/* /*
* Proview $Id: GeDynSlider.java,v 1.4 2005-09-01 14:57:50 claes Exp $ * Proview $Id: GeDynSlider.java,v 1.5 2005-11-02 13:59:08 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -31,6 +31,9 @@ public class GeDynSlider extends GeDynElem { ...@@ -31,6 +31,9 @@ public class GeDynSlider extends GeDynElem {
double maxValue; double maxValue;
double minPos; double minPos;
double maxPos; double maxPos;
String minValueAttr;
String maxValueAttr;
String insensitiveAttr;
boolean attrFound; boolean attrFound;
PwrtRefId subid; PwrtRefId subid;
...@@ -43,9 +46,16 @@ public class GeDynSlider extends GeDynElem { ...@@ -43,9 +46,16 @@ public class GeDynSlider extends GeDynElem {
Point offset = new Point(); Point offset = new Point();
float original_width = 0; float original_width = 0;
float original_height = 0; float original_height = 0;
int minValueP;
int maxValueP;
int insensitiveP;
PwrtRefId minValueSubid;
PwrtRefId maxValueSubid;
PwrtRefId insensitiveSubid;
public GeDynSlider( GeDyn dyn, String attribute, double minValue, double maxValue, public GeDynSlider( GeDyn dyn, String attribute, double minValue, double maxValue,
int direction, double minPos, double maxPos) { int direction, double minPos, double maxPos, String minValueAttr,
String maxValueAttr, String insensitiveAttr) {
super( dyn, GeDyn.mDynType_No, GeDyn.mActionType_Slider); super( dyn, GeDyn.mDynType_No, GeDyn.mActionType_Slider);
this.attribute = attribute; this.attribute = attribute;
this.minValue = minValue; this.minValue = minValue;
...@@ -53,6 +63,9 @@ public class GeDynSlider extends GeDynElem { ...@@ -53,6 +63,9 @@ public class GeDynSlider extends GeDynElem {
this.direction = direction; this.direction = direction;
this.minPos = minPos; this.minPos = minPos;
this.maxPos = maxPos; this.maxPos = maxPos;
this.minValueAttr = minValueAttr;
this.maxValueAttr = maxValueAttr;
this.insensitiveAttr = insensitiveAttr;
} }
public void setMinValue( double minValue) { public void setMinValue( double minValue) {
this.minValue = minValue; this.minValue = minValue;
...@@ -85,15 +98,70 @@ public class GeDynSlider extends GeDynElem { ...@@ -85,15 +98,70 @@ public class GeDynSlider extends GeDynElem {
typeId = ret.typeId; typeId = ret.typeId;
} }
} }
minValueP = 0;
if ( minValueAttr != null) {
attrName = dyn.getAttrName( minValueAttr);
if ( attrName.compareTo("") != 0) {
GdhrRefObjectInfo ret = dyn.en.gdh.refObjectInfo( attrName);
if ( ret.evenSts())
System.out.println( "FillLevel: " + attrName);
else {
minValueP = ret.id;
minValueSubid = ret.refid;
}
}
}
maxValueP = 0;
if ( maxValueAttr != null) {
attrName = dyn.getAttrName( maxValueAttr);
if ( attrName.compareTo("") != 0) {
GdhrRefObjectInfo ret = dyn.en.gdh.refObjectInfo( attrName);
if ( ret.evenSts())
System.out.println( "FillLevel: " + attrName);
else {
maxValueP = ret.id;
maxValueSubid = ret.refid;
}
}
}
insensitiveP = 0;
if ( insensitiveAttr != null) {
attrName = dyn.getAttrName( insensitiveAttr);
if ( attrName.compareTo("") != 0) {
GdhrRefObjectInfo ret = dyn.en.gdh.refObjectInfo( attrName);
if ( ret.evenSts())
System.out.println( "FillLevel: " + attrName);
else {
insensitiveP = ret.id;
insensitiveSubid = ret.refid;
}
}
}
} }
public void disconnect() { public void disconnect() {
if ( attrFound) if ( attrFound)
dyn.en.gdh.unrefObjectInfo( subid); dyn.en.gdh.unrefObjectInfo( subid);
if ( minValueP != 0)
dyn.en.gdh.unrefObjectInfo( minValueSubid);
if ( maxValueP != 0)
dyn.en.gdh.unrefObjectInfo( maxValueSubid);
if ( insensitiveP != 0)
dyn.en.gdh.unrefObjectInfo( insensitiveSubid);
} }
public void scan() { public void scan() {
if ( !attrFound || moveActive) if ( !attrFound || moveActive)
return; return;
if ( minValueP != 0 && maxValueP != 0) {
double minVal = dyn.en.gdh.getObjectRefInfoFloat( minValueP);
double maxVal = dyn.en.gdh.getObjectRefInfoFloat( maxValueP);
if ( (minVal != minValue || maxVal != maxValue) && maxVal != minVal) {
minValue = minVal;
maxValue = maxVal;
firstScan = true;
}
}
float width = ((JComponent)dyn.comp).getParent().getWidth(); float width = ((JComponent)dyn.comp).getParent().getWidth();
float height = ((JComponent)dyn.comp).getParent().getHeight(); float height = ((JComponent)dyn.comp).getParent().getHeight();
if ( original_width == 0) { if ( original_width == 0) {
...@@ -188,6 +256,11 @@ public class GeDynSlider extends GeDynElem { ...@@ -188,6 +256,11 @@ public class GeDynSlider extends GeDynElem {
// dyn.repaintNow = true; // dyn.repaintNow = true;
break; break;
case GeDyn.eEvent_SliderMoved: case GeDyn.eEvent_SliderMoved:
if ( insensitiveP != 0) {
boolean insensitive = dyn.en.gdh.getObjectRefInfoBoolean( insensitiveP);
if ( insensitive)
return;
}
float value; float value;
double minPos; double minPos;
double maxPos; double maxPos;
......
/* /*
* Proview $Id: GeDynSlider.java,v 1.4 2005-09-01 14:57:50 claes Exp $ * Proview $Id: GeDynSlider.java,v 1.5 2005-11-02 13:59:08 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB. * Copyright (C) 2005 SSAB Oxelsund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -31,6 +31,9 @@ public class GeDynSlider extends GeDynElem { ...@@ -31,6 +31,9 @@ public class GeDynSlider extends GeDynElem {
double maxValue; double maxValue;
double minPos; double minPos;
double maxPos; double maxPos;
String minValueAttr;
String maxValueAttr;
String insensitiveAttr;
boolean attrFound; boolean attrFound;
PwrtRefId subid; PwrtRefId subid;
...@@ -43,9 +46,16 @@ public class GeDynSlider extends GeDynElem { ...@@ -43,9 +46,16 @@ public class GeDynSlider extends GeDynElem {
Point offset = new Point(); Point offset = new Point();
float original_width = 0; float original_width = 0;
float original_height = 0; float original_height = 0;
int minValueP;
int maxValueP;
int insensitiveP;
PwrtRefId minValueSubid;
PwrtRefId maxValueSubid;
PwrtRefId insensitiveSubid;
public GeDynSlider( GeDyn dyn, String attribute, double minValue, double maxValue, public GeDynSlider( GeDyn dyn, String attribute, double minValue, double maxValue,
int direction, double minPos, double maxPos) { int direction, double minPos, double maxPos, String minValueAttr,
String maxValueAttr, String insensitiveAttr) {
super( dyn, GeDyn.mDynType_No, GeDyn.mActionType_Slider); super( dyn, GeDyn.mDynType_No, GeDyn.mActionType_Slider);
this.attribute = attribute; this.attribute = attribute;
this.minValue = minValue; this.minValue = minValue;
...@@ -53,6 +63,9 @@ public class GeDynSlider extends GeDynElem { ...@@ -53,6 +63,9 @@ public class GeDynSlider extends GeDynElem {
this.direction = direction; this.direction = direction;
this.minPos = minPos; this.minPos = minPos;
this.maxPos = maxPos; this.maxPos = maxPos;
this.minValueAttr = minValueAttr;
this.maxValueAttr = maxValueAttr;
this.insensitiveAttr = insensitiveAttr;
} }
public void setMinValue( double minValue) { public void setMinValue( double minValue) {
this.minValue = minValue; this.minValue = minValue;
...@@ -85,15 +98,70 @@ public class GeDynSlider extends GeDynElem { ...@@ -85,15 +98,70 @@ public class GeDynSlider extends GeDynElem {
typeId = ret.typeId; typeId = ret.typeId;
} }
} }
minValueP = 0;
if ( minValueAttr != null) {
attrName = dyn.getAttrName( minValueAttr);
if ( attrName.compareTo("") != 0) {
GdhrRefObjectInfo ret = dyn.en.gdh.refObjectInfo( attrName);
if ( ret.evenSts())
System.out.println( "FillLevel: " + attrName);
else {
minValueP = ret.id;
minValueSubid = ret.refid;
}
}
}
maxValueP = 0;
if ( maxValueAttr != null) {
attrName = dyn.getAttrName( maxValueAttr);
if ( attrName.compareTo("") != 0) {
GdhrRefObjectInfo ret = dyn.en.gdh.refObjectInfo( attrName);
if ( ret.evenSts())
System.out.println( "FillLevel: " + attrName);
else {
maxValueP = ret.id;
maxValueSubid = ret.refid;
}
}
}
insensitiveP = 0;
if ( insensitiveAttr != null) {
attrName = dyn.getAttrName( insensitiveAttr);
if ( attrName.compareTo("") != 0) {
GdhrRefObjectInfo ret = dyn.en.gdh.refObjectInfo( attrName);
if ( ret.evenSts())
System.out.println( "FillLevel: " + attrName);
else {
insensitiveP = ret.id;
insensitiveSubid = ret.refid;
}
}
}
} }
public void disconnect() { public void disconnect() {
if ( attrFound) if ( attrFound)
dyn.en.gdh.unrefObjectInfo( subid); dyn.en.gdh.unrefObjectInfo( subid);
if ( minValueP != 0)
dyn.en.gdh.unrefObjectInfo( minValueSubid);
if ( maxValueP != 0)
dyn.en.gdh.unrefObjectInfo( maxValueSubid);
if ( insensitiveP != 0)
dyn.en.gdh.unrefObjectInfo( insensitiveSubid);
} }
public void scan() { public void scan() {
if ( !attrFound || moveActive) if ( !attrFound || moveActive)
return; return;
if ( minValueP != 0 && maxValueP != 0) {
double minVal = dyn.en.gdh.getObjectRefInfoFloat( minValueP);
double maxVal = dyn.en.gdh.getObjectRefInfoFloat( maxValueP);
if ( (minVal != minValue || maxVal != maxValue) && maxVal != minVal) {
minValue = minVal;
maxValue = maxVal;
firstScan = true;
}
}
float width = ((JComponent)dyn.comp).getParent().getWidth(); float width = ((JComponent)dyn.comp).getParent().getWidth();
float height = ((JComponent)dyn.comp).getParent().getHeight(); float height = ((JComponent)dyn.comp).getParent().getHeight();
if ( original_width == 0) { if ( original_width == 0) {
...@@ -188,6 +256,11 @@ public class GeDynSlider extends GeDynElem { ...@@ -188,6 +256,11 @@ public class GeDynSlider extends GeDynElem {
// dyn.repaintNow = true; // dyn.repaintNow = true;
break; break;
case GeDyn.eEvent_SliderMoved: case GeDyn.eEvent_SliderMoved:
if ( insensitiveP != 0) {
boolean insensitive = dyn.en.gdh.getObjectRefInfoBoolean( insensitiveP);
if ( insensitive)
return;
}
float value; float value;
double minPos; double minPos;
double maxPos; double maxPos;
......
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