Commit dede565c authored by Claes's avatar Claes

Merge branch 'master' of 62.20.65.89:/data1/git/pwr

parents 409ef9f1 4cd9c1f8
...@@ -8598,12 +8598,12 @@ pwr_exe: ...@@ -8598,12 +8598,12 @@ pwr_exe:
99 99
99 99
27 27
2703 0 2703 31
2704 41 2704 41
2722 10000 2722 10000
2705 41 2705 41
2723 10000 2723 10000
2706 0 2706 31
2708 0 2708 0
2709 0 2709 0
2710 0 2710 0
......
...@@ -38,15 +38,18 @@ package jpwr.jop; ...@@ -38,15 +38,18 @@ package jpwr.jop;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
/* This class is used as a ComponentListener for any Component for which /**
the Aspect Ratio is important and needs to be retained. The constructor Component listener that retains the aspect ratio.
needs to know what Component it is applied to and the original size of it. <p>
From the size the aspect ratio is calculated and every time the Container This class is used as a ComponentListener for any Component for which
is resized. The size is changed so that the aspect ratio matches the, the Aspect Ratio is important and needs to be retained. The constructor
relatively, smaller one of the new width and height. needs to know what Component it is applied to and the original size of it.
syntax : new AspectTarioListener(c) From the size the aspect ratio is calculated and every time the Container
or new AspectRatioListener(c,size) is resized. The size is changed so that the aspect ratio matches the,
where c is the component, and size is the original size of it. */ relatively, smaller one of the new width and height.
syntax : new AspectTarioListener(c) or new AspectRatioListener(c,size)
where c is the component, and size is the original size of it.
*/
public class AspectRatioListener implements ComponentListener { public class AspectRatioListener implements ComponentListener {
......
...@@ -41,52 +41,35 @@ import javax.swing.tree.DefaultTreeModel; ...@@ -41,52 +41,35 @@ import javax.swing.tree.DefaultTreeModel;
import jpwr.rt.*; import jpwr.rt.*;
/** /**
* Description of the Class * Xtt class for object attributes.
* *
*@author JN3920 * @author JN
*@created November 12, 2002
*/ */
public class AttrObj extends TreeObj public class AttrObj extends TreeObj
{ {
/** Description of the Field */
int elements = 0; int elements = 0;
/** Description of the Field */
int flags; int flags;
/** Description of the Field */
// String fullName = null; // String fullName = null;
/** Description of the Field */
int lengthToSecondCol = 20; int lengthToSecondCol = 20;
/** Description of the Field */
// String name = null; // String name = null;
/** Description of the Field */
PwrtObjid objid; PwrtObjid objid;
/** Description of the Field */
GdhrRefObjectInfo refObj; GdhrRefObjectInfo refObj;
/** Description of the Field */
boolean showName = true; boolean showName = true;
/** Description of the Field */
int size; int size;
/** Description of the Field */
DefaultMutableTreeNode treeNode; DefaultMutableTreeNode treeNode;
/** Description of the Field */
int type; int type;
/** Description of the Field */
boolean valueBoolean; boolean valueBoolean;
/** Description of the Field */
float valueFloat; float valueFloat;
/** Description of the Field */
int valueInt; int valueInt;
/** Description of the Field */
String valueString = " "; String valueString = " ";
/** Description of the Field */
static DefaultTreeModel treeModel; static DefaultTreeModel treeModel;
/** /**
* Sets the value attribute of the AttrObj object * Sets the value attribute of the AttrObj object
* *
*@param value The new value value * @param value The new value value
*/ */
public void setValue(int value) public void setValue(int value)
{ {
...@@ -102,7 +85,7 @@ public class AttrObj extends TreeObj ...@@ -102,7 +85,7 @@ public class AttrObj extends TreeObj
/** /**
* Sets the value attribute of the AttrObj object * Sets the value attribute of the AttrObj object
* *
*@param value The new value value * @param value The new value value
*/ */
public void setValue(float value) public void setValue(float value)
{ {
...@@ -118,7 +101,7 @@ public class AttrObj extends TreeObj ...@@ -118,7 +101,7 @@ public class AttrObj extends TreeObj
/** /**
* Sets the value attribute of the AttrObj object * Sets the value attribute of the AttrObj object
* *
*@param value The new value value * @param value The new value value
*/ */
public void setValue(boolean value) public void setValue(boolean value)
{ {
...@@ -134,7 +117,7 @@ public class AttrObj extends TreeObj ...@@ -134,7 +117,7 @@ public class AttrObj extends TreeObj
/** /**
* Sets the value attribute of the AttrObj object * Sets the value attribute of the AttrObj object
* *
*@param value The new value value * @param value The new value value
*/ */
public void setValue(String value) public void setValue(String value)
{ {
...@@ -150,7 +133,7 @@ public class AttrObj extends TreeObj ...@@ -150,7 +133,7 @@ public class AttrObj extends TreeObj
/** /**
* Description of the Method * Description of the Method
* *
*@return Description of the Return Value * @return Description of the Return Value
*/ */
public String toString() public String toString()
{ {
......
...@@ -39,12 +39,7 @@ package jpwr.jop; ...@@ -39,12 +39,7 @@ package jpwr.jop;
import java.beans.*; import java.beans.*;
/** /**
* Title: Deprecated. Should be removed.
* Description:
* Copyright: Copyright (c) 2000
* Company:
* @author CS
* @version 1.0
*/ */
public class ClickActionEditor extends PropertyEditorSupport { public class ClickActionEditor extends PropertyEditorSupport {
......
...@@ -48,6 +48,10 @@ import javax.swing.border.*; ...@@ -48,6 +48,10 @@ import javax.swing.border.*;
import java.awt.event.*; import java.awt.event.*;
import java.util.*; import java.util.*;
/**
Cross reference window.
Loads and displays cross references for an object.
*/
public class CrrFrame extends JFrame { public class CrrFrame extends JFrame {
JScrollPane scrollPane; JScrollPane scrollPane;
JPanel contentPane; JPanel contentPane;
......
...@@ -40,20 +40,15 @@ import jpwr.jop.JopDynamic; ...@@ -40,20 +40,15 @@ import jpwr.jop.JopDynamic;
import jpwr.jop.JopEngine; import jpwr.jop.JopEngine;
import jpwr.rt.*; import jpwr.rt.*;
/** /**
* Description of the Class * Xtt class for object attribute subscriptions.
* *
*@author JN3920 * @author JN
*@created November 12, 2002
*/ */
public class DynamicObj extends TreeObj public class DynamicObj extends TreeObj
{ {
/** Description of the Field */
public XttObjAttr objAttr; public XttObjAttr objAttr;
/** Description of the Field */
int classid; int classid;
/** Description of the Field */
// String fullName; // String fullName;
/** Description of the Field */
static JopEngine en; static JopEngine en;
static boolean initDone = false; static boolean initDone = false;
...@@ -62,7 +57,7 @@ public class DynamicObj extends TreeObj ...@@ -62,7 +57,7 @@ public class DynamicObj extends TreeObj
/** /**
* Sets the objectAttributeValue attribute of the DynamicObj object * Sets the objectAttributeValue attribute of the DynamicObj object
* *
*@param obj The new objectAttributeValue value * @param obj The new objectAttributeValue value
*/ */
public void setObjectAttributeValue(AttrObj obj) public void setObjectAttributeValue(AttrObj obj)
{ {
...@@ -109,9 +104,9 @@ public class DynamicObj extends TreeObj ...@@ -109,9 +104,9 @@ public class DynamicObj extends TreeObj
/** /**
* Sets the typeIdString attribute of the DynamicObj object * Sets the typeIdString attribute of the DynamicObj object
* *
*@param type The new typeIdString value * @param type The new typeIdString value
*@param size The new typeIdString value * @param size The new typeIdString size
*@return Description of the Return Value * @return The typeId suffix
*/ */
public String setTypeIdString(int type, int size) public String setTypeIdString(int type, int size)
{ {
......
...@@ -41,8 +41,11 @@ import javax.swing.table.DefaultTableCellRenderer; ...@@ -41,8 +41,11 @@ import javax.swing.table.DefaultTableCellRenderer;
import jpwr.rt.Mh; import jpwr.rt.Mh;
import jpwr.rt.MhrEvent; import jpwr.rt.MhrEvent;
/* This class is used to make sure an EventTableModel in a JaTable is presented /**
* in a graphically appealing manner. */ Cell renderer class for event table.
This class is used to make sure an EventTableModel in a JaTable is presented
in a graphically appealing manner.
*/
public class EventTableCellRender extends DefaultTableCellRenderer { public class EventTableCellRender extends DefaultTableCellRenderer {
...@@ -56,13 +59,13 @@ public class EventTableCellRender extends DefaultTableCellRenderer { ...@@ -56,13 +59,13 @@ public class EventTableCellRender extends DefaultTableCellRenderer {
* Gets the tableCellRendererComponent attribute of the * Gets the tableCellRendererComponent attribute of the
* EventTableCellRender object * EventTableCellRender object
* *
*@param table Description of the Parameter * @param table Description of the Parameter
*@param value Description of the Parameter * @param value Description of the Parameter
*@param isSelected Description of the Parameter * @param isSelected Description of the Parameter
*@param hasFocus Description of the Parameter * @param hasFocus Description of the Parameter
*@param row Description of the Parameter * @param row Description of the Parameter
*@param column Description of the Parameter * @param column Description of the Parameter
*@return The tableCellRendererComponent value * @return The tableCellRendererComponent value
*/ */
public Component getTableCellRendererComponent(JTable table, Object value, public Component getTableCellRendererComponent(JTable table, Object value,
boolean isSelected, boolean hasFocus, int row, int column) { boolean isSelected, boolean hasFocus, int row, int column) {
......
...@@ -37,7 +37,12 @@ ...@@ -37,7 +37,12 @@
package jpwr.jop; package jpwr.jop;
/**
Flow basic declarations.
<b>
The flow utility reads flw-files contaning the plc code graphics, diplays
the graphics and starts plc trace to show the current status of the code.
*/
public class Flow { public class Flow {
public static final int DRAWOFFSET = 2; public static final int DRAWOFFSET = 2;
......
...@@ -43,6 +43,10 @@ import java.awt.geom.*; ...@@ -43,6 +43,10 @@ import java.awt.geom.*;
import javax.swing.*; import javax.swing.*;
/**
Flow annotation.
Place in a node for an instance specific text.
*/
public class FlowAnnot implements FlowArrayElem { public class FlowAnnot implements FlowArrayElem {
FlowPoint p; FlowPoint p;
int draw_type; int draw_type;
......
...@@ -43,6 +43,9 @@ import java.awt.geom.*; ...@@ -43,6 +43,9 @@ import java.awt.geom.*;
import javax.swing.*; import javax.swing.*;
/**
Flow arc element.
*/
public class FlowArc implements FlowArrayElem { public class FlowArc implements FlowArrayElem {
FlowPoint ll; FlowPoint ll;
FlowPoint ur; FlowPoint ur;
......
...@@ -43,6 +43,9 @@ import java.awt.geom.*; ...@@ -43,6 +43,9 @@ import java.awt.geom.*;
import javax.swing.*; import javax.swing.*;
/**
Flow container for elements
*/
public class FlowArray { public class FlowArray {
//Vector<Object> a = new Vector<Object>(); //Vector<Object> a = new Vector<Object>();
Vector a = new Vector(); Vector a = new Vector();
......
...@@ -43,6 +43,10 @@ import java.awt.geom.*; ...@@ -43,6 +43,10 @@ import java.awt.geom.*;
import javax.swing.*; import javax.swing.*;
/**
Flow arrow element.
Used for connections with arrows.
*/
public class FlowArrow implements FlowArrayElem { public class FlowArrow implements FlowArrayElem {
FlowPoint p1; FlowPoint p1;
FlowPoint p2; FlowPoint p2;
......
...@@ -40,6 +40,10 @@ import java.io.*; ...@@ -40,6 +40,10 @@ import java.io.*;
import java.util.*; import java.util.*;
/**
Flow common data.
Common data for a flow context.
*/
public class FlowCmn { public class FlowCmn {
static final int display_level = Flow.mDisplayLevel_1; static final int display_level = Flow.mDisplayLevel_1;
boolean debug; boolean debug;
......
...@@ -43,6 +43,10 @@ import java.awt.geom.*; ...@@ -43,6 +43,10 @@ import java.awt.geom.*;
import javax.swing.*; import javax.swing.*;
/**
Flow connection.
A connection between to nodes.
*/
public class FlowCon extends JComponent implements FlowComponent, JopDynamic { public class FlowCon extends JComponent implements FlowComponent, JopDynamic {
double x_right; double x_right;
double x_left; double x_left;
......
...@@ -40,6 +40,10 @@ import java.io.*; ...@@ -40,6 +40,10 @@ import java.io.*;
import java.util.*; import java.util.*;
/**
Flow connection class.
Specifies appearance and function for connections.
*/
public class FlowConClass { public class FlowConClass {
String cc_name; String cc_name;
int con_type; int con_type;
......
...@@ -43,6 +43,10 @@ import java.awt.geom.*; ...@@ -43,6 +43,10 @@ import java.awt.geom.*;
import javax.swing.*; import javax.swing.*;
/**
Flow connection point element.
Specifies a connection point in a node.
*/
public class FlowConPoint implements FlowArrayElem { public class FlowConPoint implements FlowArrayElem {
FlowPoint p; FlowPoint p;
int number; int number;
......
...@@ -41,6 +41,9 @@ import java.util.*; ...@@ -41,6 +41,9 @@ import java.util.*;
import jpwr.rt.*; import jpwr.rt.*;
/**
Flow context.
*/
public class FlowCtx implements FlowCtxInterface { public class FlowCtx implements FlowCtxInterface {
FlowCmn cmn; FlowCmn cmn;
String name; String name;
......
...@@ -48,6 +48,9 @@ import java.awt.event.*; ...@@ -48,6 +48,9 @@ import java.awt.event.*;
import java.net.*; import java.net.*;
import java.applet.*; import java.applet.*;
/**
Frame loading and displaying plc code.
*/
public class FlowFrame extends JFrame implements JopUtilityIfc, GdhApplIfc { public class FlowFrame extends JFrame implements JopUtilityIfc, GdhApplIfc {
JScrollPane scrollPane; JScrollPane scrollPane;
JPanel contentPane; JPanel contentPane;
......
...@@ -43,6 +43,9 @@ import java.awt.geom.*; ...@@ -43,6 +43,9 @@ import java.awt.geom.*;
import javax.swing.*; import javax.swing.*;
/**
Flow line element.
*/
public class FlowLine implements FlowArrayElem { public class FlowLine implements FlowArrayElem {
FlowPoint p1; FlowPoint p1;
FlowPoint p2; FlowPoint p2;
......
...@@ -46,6 +46,11 @@ import javax.swing.*; ...@@ -46,6 +46,11 @@ import javax.swing.*;
import java.awt.event.*; import java.awt.event.*;
/**
Flow node.
<p>
A flow node is a function object built by element of type arcs, lines, recangles, texts etc.
*/
public class FlowNode extends JComponent implements FlowComponent, JopDynamic { public class FlowNode extends JComponent implements FlowComponent, JopDynamic {
static final int OFFSET = 2; static final int OFFSET = 2;
double x_right; double x_right;
......
...@@ -42,6 +42,10 @@ import java.awt.*; ...@@ -42,6 +42,10 @@ import java.awt.*;
import java.awt.geom.*; import java.awt.geom.*;
import javax.swing.*; import javax.swing.*;
/**
Flow node description class.
Layout and specification of function objects.
*/
public class FlowNodeClass { public class FlowNodeClass {
FlowArray a; FlowArray a;
String nc_name; String nc_name;
......
...@@ -39,7 +39,9 @@ package jpwr.jop; ...@@ -39,7 +39,9 @@ package jpwr.jop;
import java.io.*; import java.io.*;
import java.util.*; import java.util.*;
/**
Float point object with x and y coordinate.
*/
public class FlowPoint { public class FlowPoint {
double x; double x;
double y; double y;
......
...@@ -42,6 +42,9 @@ import java.awt.*; ...@@ -42,6 +42,9 @@ import java.awt.*;
import java.awt.geom.*; import java.awt.geom.*;
import javax.swing.*; import javax.swing.*;
/**
Flow rectangle element.
*/
public class FlowRect implements FlowArrayElem { public class FlowRect implements FlowArrayElem {
FlowPoint ll; FlowPoint ll;
FlowPoint ur; FlowPoint ur;
......
...@@ -42,7 +42,9 @@ import java.awt.*; ...@@ -42,7 +42,9 @@ import java.awt.*;
import java.awt.geom.*; import java.awt.geom.*;
import javax.swing.*; import javax.swing.*;
/**
Flow text element.
*/
public class FlowText implements FlowArrayElem { public class FlowText implements FlowArrayElem {
FlowPoint p; FlowPoint p;
int draw_type; int draw_type;
......
...@@ -40,6 +40,9 @@ import java.io.*; ...@@ -40,6 +40,9 @@ import java.io.*;
import java.util.*; import java.util.*;
/**
Flow class to read arrays.
*/
public class FlowVector { public class FlowVector {
public FlowVector() { public FlowVector() {
} }
......
...@@ -36,6 +36,9 @@ ...@@ -36,6 +36,9 @@
package jpwr.jop; package jpwr.jop;
/**
Ge basic definitions.
*/
public class Ge { public class Ge {
// Directions // Directions
......
...@@ -37,56 +37,14 @@ ...@@ -37,56 +37,14 @@
package jpwr.jop; package jpwr.jop;
import java.text.*; import java.text.*;
/**
String formating with c-printf format.
*/
public class GeCFormat { public class GeCFormat {
public GeCFormat( String format) { public GeCFormat( String format) {
int f_idx, p_idx; int f_idx, p_idx;
try { try {
/*
if ( (f_idx = format.indexOf('f')) != -1) {
format_type = FRM_F;
p_idx = format.indexOf('.');
if ( format.charAt(1) == '-')
no_space = 1;
if ( p_idx == -1) {
d = 0;
h = Integer.valueOf(format.substring( 1+no_space, f_idx)).intValue();
}
else {
d = Integer.valueOf(format.substring( p_idx + 1, f_idx)).intValue();
h = Integer.valueOf(format.substring( 1+no_space, p_idx)).intValue();
}
}
else if ( (f_idx = format.indexOf('d')) != -1) {
format_type = FRM_D;
if ( format.charAt(1) == '-')
no_space = 1;
if ( f_idx-no_space != 1) {
h = Integer.valueOf(format.substring( 1+no_space, f_idx)).intValue();
}
else
h = 4;
}
else if ( (f_idx = format.indexOf('s')) != -1) {
format_type = FRM_S;
if ( format.charAt(1) == '-')
no_space = 1;
p_idx = format.indexOf('.');
if ( p_idx == -1) {
d = 0;
if ( f_idx == 1)
h = 0;
else
h = Integer.valueOf(format.substring( 1+no_space, f_idx)).intValue();
}
else {
d = 0;
h = Integer.valueOf(format.substring( 1+no_space, p_idx)).intValue();
}
}
*/
if ( (f_idx = format.indexOf('o')) != -1) { if ( (f_idx = format.indexOf('o')) != -1) {
if ( f_idx >= 1 && format.charAt(f_idx-1) == '1') if ( f_idx >= 1 && format.charAt(f_idx-1) == '1')
format_type = FRM_1O; format_type = FRM_1O;
...@@ -155,43 +113,6 @@ public class GeCFormat { ...@@ -155,43 +113,6 @@ public class GeCFormat {
} }
else else
return buff; return buff;
/*
int j, len;
int t2 = (int) value;
int m;
buff.setLength(0);
if ( h == -1)
return buff;
buff.append(t2);
len = buff.length();
if ( d > 0) {
if ( no_space == 0) {
for ( j = 0; j < h-d-1-len; j++)
buff.insert(0, " ");
}
buff.append(".");
m = 1;
for ( j = 0; j < d; j++)
m *= 10;
if(value >= 0.0)
t2 = (int)((value - (float)t2) * m + 0.5f);
else
t2 = (int)((value - (float)t2) * m - 0.5f);
t2 = Math.abs( t2);
for ( j = 0; j < d - Integer.toString(t2).length(); j++)
buff.append('0');
buff.append(t2);
}
else {
for ( j = 0; j < h-d-len; j++)
buff.insert(0," ");
}
return buff;
}
*/
} }
public StringBuffer format( int value, StringBuffer buff) { public StringBuffer format( int value, StringBuffer buff) {
if ( pfo != null) { if ( pfo != null) {
...@@ -206,20 +127,6 @@ public class GeCFormat { ...@@ -206,20 +127,6 @@ public class GeCFormat {
} }
else else
return buff; return buff;
/*
int j, len;
int t2 = value;
if ( h == -1)
return buff;
buff.setLength(0);
buff.append(value);
len = buff.length();
for ( j = 0; j < h-len; j++)
buff.insert(0," ");
return buff;
*/
} }
public StringBuffer format( boolean value, StringBuffer buff) { public StringBuffer format( boolean value, StringBuffer buff) {
...@@ -246,20 +153,6 @@ public class GeCFormat { ...@@ -246,20 +153,6 @@ public class GeCFormat {
} }
else else
return buff; return buff;
/*
int j, len;
if ( h == -1)
return buff;
len = value.length();
if ( len > h && h != 0)
len = h;
buff.setLength(0);
for ( j = 0; j < len; j++)
buff.append(value.charAt(j));
return buff;
*/
} }
case FRM_O: { case FRM_O: {
int idx, j, len; int idx, j, len;
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
package jpwr.jop; package jpwr.jop;
import java.awt.*; import java.awt.*;
/**
Ge color specificatins and color calculations.
*/
public class GeColor { public class GeColor {
// Color tones // Color tones
...@@ -456,6 +459,9 @@ public class GeColor { ...@@ -456,6 +459,9 @@ public class GeColor {
return colors[idx]; return colors[idx];
} }
/**
Ge RGB color.
*/
static public class Rgb { static public class Rgb {
public Rgb() {} public Rgb() {}
double r; double r;
......
...@@ -39,12 +39,7 @@ package jpwr.jop; ...@@ -39,12 +39,7 @@ package jpwr.jop;
import java.beans.*; import java.beans.*;
/** /**
* Title: * Deprecated
* Description:
* Copyright: Copyright (c) 2000
* Company:
* @author CS
* @version 1.0
*/ */
public class GeColorBrightnessEditor extends PropertyEditorSupport { public class GeColorBrightnessEditor extends PropertyEditorSupport {
......
...@@ -39,12 +39,7 @@ package jpwr.jop; ...@@ -39,12 +39,7 @@ package jpwr.jop;
import java.beans.*; import java.beans.*;
/** /**
* Title: * Deprecated
* Description:
* Copyright: Copyright (c) 2000
* Company:
* @author CS
* @version 1.0
*/ */
public class GeColorEditor extends PropertyEditorSupport { public class GeColorEditor extends PropertyEditorSupport {
......
...@@ -39,14 +39,8 @@ package jpwr.jop; ...@@ -39,14 +39,8 @@ package jpwr.jop;
import java.beans.*; import java.beans.*;
/** /**
* Title: * Deprecated
* Description:
* Copyright: Copyright (c) 2000
* Company:
* @author CS
* @version 1.0
*/ */
public class GeColorIntensityEditor extends PropertyEditorSupport { public class GeColorIntensityEditor extends PropertyEditorSupport {
public GeColorIntensityEditor() { public GeColorIntensityEditor() {
......
...@@ -39,14 +39,8 @@ package jpwr.jop; ...@@ -39,14 +39,8 @@ package jpwr.jop;
import java.beans.*; import java.beans.*;
/** /**
* Title: Deprecated
* Description: */
* Copyright: Copyright (c) 2000
* Company:
* @author CS
* @version 1.0
*/
public class GeColorShiftEditor extends PropertyEditorSupport { public class GeColorShiftEditor extends PropertyEditorSupport {
public GeColorShiftEditor() { public GeColorShiftEditor() {
......
...@@ -39,14 +39,8 @@ package jpwr.jop; ...@@ -39,14 +39,8 @@ package jpwr.jop;
import java.beans.*; import java.beans.*;
/** /**
* Title: Deprecated
* Description: */
* Copyright: Copyright (c) 2000
* Company:
* @author CS
* @version 1.0
*/
public class GeColorToneEditor extends PropertyEditorSupport { public class GeColorToneEditor extends PropertyEditorSupport {
public GeColorToneEditor() { public GeColorToneEditor() {
......
...@@ -45,6 +45,9 @@ import javax.swing.Timer; ...@@ -45,6 +45,9 @@ import javax.swing.Timer;
import java.awt.event.*; import java.awt.event.*;
import jpwr.rt.*; import jpwr.rt.*;
/**
Ge base class for subgraphs.
*/
public class GeComponent extends JComponent implements GeComponentIfc, public class GeComponent extends JComponent implements GeComponentIfc,
JopDynamic, JopConfirm, ActionListener { JopDynamic, JopConfirm, ActionListener {
public Dimension size; public Dimension size;
......
...@@ -38,6 +38,9 @@ package jpwr.jop; ...@@ -38,6 +38,9 @@ package jpwr.jop;
import jpwr.rt.*; import jpwr.rt.*;
import java.awt.event.*; import java.awt.event.*;
/**
Ge dynamics, basic definitions and utilities.
*/
public class GeDyn { public class GeDyn {
public static final int mDynType_No = 0; public static final int mDynType_No = 0;
public static final int mDynType_Inherit = 1 << 0; public static final int mDynType_Inherit = 1 << 0;
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
package jpwr.jop; package jpwr.jop;
import jpwr.rt.*; import jpwr.rt.*;
/**
Ge dynamic type AnalogColor.
*/
public class GeDynAnalogColor extends GeDynElem { public class GeDynAnalogColor extends GeDynElem {
String attribute; String attribute;
double limit; double limit;
......
...@@ -39,6 +39,9 @@ import jpwr.rt.*; ...@@ -39,6 +39,9 @@ import jpwr.rt.*;
import java.awt.*; import java.awt.*;
import javax.swing.*; import javax.swing.*;
/**
Ge dynamic type AnalogShift.
*/
public class GeDynAnalogShift extends GeDynElem { public class GeDynAnalogShift extends GeDynElem {
String attribute; String attribute;
......
...@@ -41,6 +41,9 @@ import java.awt.event.*; ...@@ -41,6 +41,9 @@ import java.awt.event.*;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.*; import javax.swing.event.*;
/**
Ge dynamic type AnalogText.
*/
public class GeDynAnalogText extends GeDynOptionMenu { public class GeDynAnalogText extends GeDynOptionMenu {
public GeDynAnalogText( GeDyn dyn, String attribute, String[] itemsText, int[] itemsEnum) { public GeDynAnalogText( GeDyn dyn, String attribute, String[] itemsText, int[] itemsEnum) {
......
...@@ -38,6 +38,9 @@ package jpwr.jop; ...@@ -38,6 +38,9 @@ package jpwr.jop;
import javax.swing.*; import javax.swing.*;
import jpwr.rt.*; import jpwr.rt.*;
/**
Ge dynamic type Animation.
*/
public class GeDynAnimation extends GeDynElem { public class GeDynAnimation extends GeDynElem {
String attribute; String attribute;
int sequence; int sequence;
......
...@@ -40,6 +40,9 @@ import java.awt.event.*; ...@@ -40,6 +40,9 @@ import java.awt.event.*;
import java.awt.*; import java.awt.*;
import javax.swing.*; import javax.swing.*;
/**
Ge action type CloseGraph.
*/
public class GeDynCloseGraph extends GeDynElem { public class GeDynCloseGraph extends GeDynElem {
String command; String command;
......
...@@ -38,6 +38,9 @@ package jpwr.jop; ...@@ -38,6 +38,9 @@ package jpwr.jop;
import jpwr.rt.*; import jpwr.rt.*;
import java.awt.event.*; import java.awt.event.*;
/**
Ge action type Command.
*/
public class GeDynCommand extends GeDynElem { public class GeDynCommand extends GeDynElem {
String command; String command;
......
...@@ -39,6 +39,9 @@ import jpwr.rt.*; ...@@ -39,6 +39,9 @@ import jpwr.rt.*;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
/**
Ge action type Confirm.
*/
public class GeDynConfirm extends GeDynElem { public class GeDynConfirm extends GeDynElem {
String text; String text;
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
package jpwr.jop; package jpwr.jop;
import jpwr.rt.*; import jpwr.rt.*;
/**
Ge dynamic type DigBorder.
*/
public class GeDynDigBorder extends GeDynElem { public class GeDynDigBorder extends GeDynElem {
String attribute; String attribute;
int color; int color;
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
package jpwr.jop; package jpwr.jop;
import jpwr.rt.*; import jpwr.rt.*;
/**
Ge dynamic type DigColor.
*/
public class GeDynDigColor extends GeDynElem { public class GeDynDigColor extends GeDynElem {
String attribute; String attribute;
int color; int color;
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
package jpwr.jop; package jpwr.jop;
import jpwr.rt.*; import jpwr.rt.*;
/**
Ge dynamic type DigError.
*/
public class GeDynDigError extends GeDynElem { public class GeDynDigError extends GeDynElem {
String attribute; String attribute;
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
package jpwr.jop; package jpwr.jop;
import jpwr.rt.*; import jpwr.rt.*;
/**
Ge dynamic type DigFlash.
*/
public class GeDynDigFlash extends GeDynElem { public class GeDynDigFlash extends GeDynElem {
String attribute; String attribute;
int color; int color;
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
package jpwr.jop; package jpwr.jop;
import jpwr.rt.*; import jpwr.rt.*;
/**
Ge dynamic type DigLowColor.
*/
public class GeDynDigLowColor extends GeDynElem { public class GeDynDigLowColor extends GeDynElem {
String attribute; String attribute;
int color; int color;
......
...@@ -39,6 +39,9 @@ import jpwr.rt.*; ...@@ -39,6 +39,9 @@ import jpwr.rt.*;
import java.awt.*; import java.awt.*;
import javax.swing.*; import javax.swing.*;
/**
Ge dynamic type DigShift.
*/
public class GeDynDigShift extends GeDynElem { public class GeDynDigShift extends GeDynElem {
String attribute; String attribute;
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
package jpwr.jop; package jpwr.jop;
import jpwr.rt.*; import jpwr.rt.*;
/**
Ge dynamic type DigText.
*/
public class GeDynDigText extends GeDynElem { public class GeDynDigText extends GeDynElem {
String attribute; String attribute;
String lowText; String lowText;
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
package jpwr.jop; package jpwr.jop;
import jpwr.rt.*; import jpwr.rt.*;
/**
Ge dynamic type DigWarning.
*/
public class GeDynDigWarning extends GeDynElem { public class GeDynDigWarning extends GeDynElem {
String attribute; String attribute;
......
...@@ -38,6 +38,9 @@ package jpwr.jop; ...@@ -38,6 +38,9 @@ package jpwr.jop;
import jpwr.rt.*; import jpwr.rt.*;
import java.awt.event.*; import java.awt.event.*;
/**
Ge dynamics base class.
*/
public class GeDynElem implements GeDynElemIfc { public class GeDynElem implements GeDynElemIfc {
public GeDyn dyn; public GeDyn dyn;
public int dynType; public int dynType;
...@@ -54,12 +57,16 @@ public class GeDynElem implements GeDynElemIfc { ...@@ -54,12 +57,16 @@ public class GeDynElem implements GeDynElemIfc {
public int getActionType() { public int getActionType() {
return actionType; return actionType;
} }
/** Init function to connect and subscribe to attributes and objects */
public void connect() { public void connect() {
} }
/** Close function to remove subscriptions */
public void disconnect() { public void disconnect() {
} }
/** Function call every scan */
public void scan() { public void scan() {
} }
/** Function called when an event has occured */
public void action( int eventType, MouseEvent e) { public void action( int eventType, MouseEvent e) {
} }
} }
......
...@@ -38,6 +38,9 @@ package jpwr.jop; ...@@ -38,6 +38,9 @@ package jpwr.jop;
import jpwr.rt.*; import jpwr.rt.*;
import javax.swing.*; import javax.swing.*;
/**
Ge dynamic type FillLevel.
*/
public class GeDynFillLevel extends GeDynElem { public class GeDynFillLevel extends GeDynElem {
String attribute; String attribute;
int color; int color;
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
package jpwr.jop; package jpwr.jop;
import jpwr.rt.*; import jpwr.rt.*;
/**
Ge dynamic type HostObject.
*/
public class GeDynHostObject extends GeDynElem { public class GeDynHostObject extends GeDynElem {
public GeDynHostObject( GeDyn dyn, String hostObject) { public GeDynHostObject( GeDyn dyn, String hostObject) {
......
...@@ -38,6 +38,9 @@ package jpwr.jop; ...@@ -38,6 +38,9 @@ package jpwr.jop;
import jpwr.rt.*; import jpwr.rt.*;
import java.awt.event.*; import java.awt.event.*;
/**
Ge action type IncrAnalog.
*/
public class GeDynIncrAnalog extends GeDynElem { public class GeDynIncrAnalog extends GeDynElem {
String attribute; String attribute;
double increment; double increment;
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
package jpwr.jop; package jpwr.jop;
import jpwr.rt.*; import jpwr.rt.*;
/**
Ge dynamic type Invisible.
*/
public class GeDynInvisible extends GeDynElem { public class GeDynInvisible extends GeDynElem {
String attribute; String attribute;
int dimmed; int dimmed;
......
...@@ -39,6 +39,9 @@ import java.awt.*; ...@@ -39,6 +39,9 @@ import java.awt.*;
import javax.swing.*; import javax.swing.*;
import jpwr.rt.*; import jpwr.rt.*;
/**
Ge dynamic type Move.
*/
public class GeDynMove extends GeDynElem { public class GeDynMove extends GeDynElem {
public String moveXAttribute; public String moveXAttribute;
public String moveYAttribute; public String moveYAttribute;
......
...@@ -41,6 +41,9 @@ import java.awt.event.*; ...@@ -41,6 +41,9 @@ import java.awt.event.*;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.*; import javax.swing.event.*;
/**
Ge action type OptionMenu.
*/
public class GeDynOptionMenu extends GeDynElem { public class GeDynOptionMenu extends GeDynElem {
String attribute; String attribute;
String[] itemsText; String[] itemsText;
......
...@@ -39,6 +39,9 @@ import jpwr.rt.*; ...@@ -39,6 +39,9 @@ import jpwr.rt.*;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
/**
Ge dynamic type PopupMenu.
*/
public class GeDynPopupMenu extends GeDynElem { public class GeDynPopupMenu extends GeDynElem {
String refObject; String refObject;
......
...@@ -41,6 +41,9 @@ import java.awt.event.*; ...@@ -41,6 +41,9 @@ import java.awt.event.*;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.*; import javax.swing.event.*;
/**
Ge action type PulldownMenu.
*/
public class GeDynPulldownMenu extends GeDynElem { public class GeDynPulldownMenu extends GeDynElem {
String[] itemsText; String[] itemsText;
GeDyn[] itemsDyn; GeDyn[] itemsDyn;
......
...@@ -40,6 +40,9 @@ import java.awt.event.*; ...@@ -40,6 +40,9 @@ import java.awt.event.*;
import java.awt.*; import java.awt.*;
import javax.swing.*; import javax.swing.*;
/**
Ge action type RadioButton.
*/
public class GeDynRadioButton extends GeDynElem { public class GeDynRadioButton extends GeDynElem {
String attribute; String attribute;
......
...@@ -38,6 +38,9 @@ package jpwr.jop; ...@@ -38,6 +38,9 @@ package jpwr.jop;
import jpwr.rt.*; import jpwr.rt.*;
import java.awt.event.*; import java.awt.event.*;
/**
Ge action type ResetDig.
*/
public class GeDynResetDig extends GeDynElem { public class GeDynResetDig extends GeDynElem {
String attribute; String attribute;
......
...@@ -38,6 +38,9 @@ package jpwr.jop; ...@@ -38,6 +38,9 @@ package jpwr.jop;
import javax.swing.*; import javax.swing.*;
import jpwr.rt.*; import jpwr.rt.*;
/**
Ge dynamic type Rotate.
*/
public class GeDynRotate extends GeDynElem { public class GeDynRotate extends GeDynElem {
String attribute; String attribute;
double x0; double x0;
......
...@@ -38,6 +38,9 @@ package jpwr.jop; ...@@ -38,6 +38,9 @@ package jpwr.jop;
import jpwr.rt.*; import jpwr.rt.*;
import java.awt.event.*; import java.awt.event.*;
/**
Ge action type SetDig.
*/
public class GeDynSetDig extends GeDynElem { public class GeDynSetDig extends GeDynElem {
String attribute; String attribute;
......
...@@ -38,6 +38,9 @@ package jpwr.jop; ...@@ -38,6 +38,9 @@ package jpwr.jop;
import jpwr.rt.*; import jpwr.rt.*;
import java.awt.event.*; import java.awt.event.*;
/**
Ge action type SetValue.
*/
public class GeDynSetValue extends GeDynElem { public class GeDynSetValue extends GeDynElem {
String attribute; String attribute;
String value; String value;
......
...@@ -41,6 +41,9 @@ import java.awt.*; ...@@ -41,6 +41,9 @@ import java.awt.*;
import javax.swing.*; import javax.swing.*;
/**
Ge dynamic type Slider.
*/
public class GeDynSlider extends GeDynElem { public class GeDynSlider extends GeDynElem {
String attribute; String attribute;
public int direction; public int direction;
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
package jpwr.jop; package jpwr.jop;
import jpwr.rt.*; import jpwr.rt.*;
/**
Ge dynamic type StatusColor.
*/
public class GeDynStatusColor extends GeDynElem { public class GeDynStatusColor extends GeDynElem {
String attribute; String attribute;
int nostatusColor; int nostatusColor;
......
...@@ -38,6 +38,9 @@ package jpwr.jop; ...@@ -38,6 +38,9 @@ package jpwr.jop;
import jpwr.rt.*; import jpwr.rt.*;
import java.awt.event.*; import java.awt.event.*;
/**
Ge action type StoDig.
*/
public class GeDynStoDig extends GeDynElem { public class GeDynStoDig extends GeDynElem {
String attribute; String attribute;
......
...@@ -39,6 +39,9 @@ import jpwr.rt.*; ...@@ -39,6 +39,9 @@ import jpwr.rt.*;
import java.awt.*; import java.awt.*;
import java.awt.event.*; import java.awt.event.*;
/**
Ge dynamic type Table.
*/
public class GeDynTable extends GeDynElem { public class GeDynTable extends GeDynElem {
public String[] attribute; public String[] attribute;
public String[] selAttribute; public String[] selAttribute;
......
...@@ -39,6 +39,9 @@ import jpwr.rt.*; ...@@ -39,6 +39,9 @@ import jpwr.rt.*;
import java.awt.*; import java.awt.*;
import javax.swing.*; import javax.swing.*;
/**
Ge action TipText.
*/
public class GeDynTipText extends GeDynElem { public class GeDynTipText extends GeDynElem {
String text; String text;
......
...@@ -38,6 +38,9 @@ package jpwr.jop; ...@@ -38,6 +38,9 @@ package jpwr.jop;
import jpwr.rt.*; import jpwr.rt.*;
import java.awt.event.*; import java.awt.event.*;
/**
Ge action type ToggleDig.
*/
public class GeDynToggleDig extends GeDynElem { public class GeDynToggleDig extends GeDynElem {
String attribute; String attribute;
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
package jpwr.jop; package jpwr.jop;
import jpwr.rt.*; import jpwr.rt.*;
/**
Ge dynamic type Value.
*/
public class GeDynValue extends GeDynElem { public class GeDynValue extends GeDynElem {
public String attribute; public String attribute;
......
...@@ -39,6 +39,9 @@ import jpwr.rt.*; ...@@ -39,6 +39,9 @@ import jpwr.rt.*;
import java.awt.event.*; import java.awt.event.*;
import javax.swing.*; import javax.swing.*;
/**
Ge action type ValueInput.
*/
public class GeDynValueInput extends GeDynElem { public class GeDynValueInput extends GeDynElem {
double minValue; double minValue;
double maxValue; double maxValue;
......
...@@ -42,6 +42,9 @@ import java.awt.font.*; ...@@ -42,6 +42,9 @@ import java.awt.font.*;
import javax.swing.*; import javax.swing.*;
import jpwr.rt.*; import jpwr.rt.*;
/**
Ge dynamic type XYCurve.
*/
public class GeDynXYCurve extends GeDynElem { public class GeDynXYCurve extends GeDynElem {
String x_attr; String x_attr;
String y_attr; String y_attr;
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
package jpwr.jop; package jpwr.jop;
import jpwr.rt.*; import jpwr.rt.*;
/**
Ge dynamic data.
*/
public class GeDyndata { public class GeDyndata {
public static final int eTrace_Inherit = 0; public static final int eTrace_Inherit = 0;
public static final int eTrace_Dig = 1; public static final int eTrace_Dig = 1;
......
...@@ -40,6 +40,9 @@ import java.awt.*; ...@@ -40,6 +40,9 @@ import java.awt.*;
import java.awt.geom.*; import java.awt.geom.*;
import java.awt.event.*; import java.awt.event.*;
/**
Ge color gradients drawing.
*/
public class GeGradient { public class GeGradient {
public static final int eGradient_No = 0; public static final int eGradient_No = 0;
public static final int eGradient_HorizontalUp = 1; public static final int eGradient_HorizontalUp = 1;
......
...@@ -44,6 +44,9 @@ import javax.swing.*; ...@@ -44,6 +44,9 @@ import javax.swing.*;
import javax.swing.Timer; import javax.swing.Timer;
import java.awt.event.*; import java.awt.event.*;
/**
Ge image component.
*/
public class GeImage extends JComponent implements ActionListener { public class GeImage extends JComponent implements ActionListener {
Dimension size; Dimension size;
Object root; Object root;
......
...@@ -43,6 +43,9 @@ import javax.swing.*; ...@@ -43,6 +43,9 @@ import javax.swing.*;
import java.awt.event.*; import java.awt.event.*;
import jpwr.rt.*; import jpwr.rt.*;
/**
Ge slider component.
*/
public class GeSlider extends JComponent implements JopDynamic, ActionListener{ public class GeSlider extends JComponent implements JopDynamic, ActionListener{
Timer timer = new Timer(500, this); Timer timer = new Timer(500, this);
public Object root; public Object root;
......
...@@ -45,6 +45,9 @@ import javax.swing.Timer; ...@@ -45,6 +45,9 @@ import javax.swing.Timer;
import javax.swing.table.*; import javax.swing.table.*;
import javax.swing.event.*; import javax.swing.event.*;
/**
Ge table component.
*/
public class GeTable extends JScrollPane implements GeComponentIfc, public class GeTable extends JScrollPane implements GeComponentIfc,
JopDynamic, ActionListener, ListSelectionListener JopDynamic, ActionListener, ListSelectionListener
{ {
......
...@@ -44,6 +44,9 @@ import javax.swing.*; ...@@ -44,6 +44,9 @@ import javax.swing.*;
import javax.swing.Timer; import javax.swing.Timer;
import javax.swing.border.*; import javax.swing.border.*;
/**
Ge textfield component.
*/
public class GeTextField extends JTextField implements GeComponentIfc, public class GeTextField extends JTextField implements GeComponentIfc,
JopDynamic, JopConfirm, ActionListener JopDynamic, JopConfirm, ActionListener
{ {
......
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2014 SSAB EMEA AB.
*
* This file is part of Proview.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
package jpwr.jop;
import jpwr.rt.*;
//import Logg;
import java.awt.*;
import java.awt.event.*;
import java.awt.font.*;
import java.awt.geom.*;
import java.awt.image.*;
import javax.swing.event.*;
import java.io.*;
import java.net.*;
import java.util.*;
import javax.swing.*;
import javax.swing.table.AbstractTableModel;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
import java.awt.event.*;
/**
* Description of the Class
*
*@author JN3920
*@created November 12, 2002
*/
public class MhFrame extends JFrame
{
/** Description of the Field */
BorderLayout borderLayout1 = new BorderLayout();
/** Description of the Field */
BorderLayout borderLayout5 = new BorderLayout();
/** Description of the Field */
JPanel contentPane;
/** Description of the Field */
JLabel labelMessage = new JLabel("MhClient version 1.0");
/** Description of the Field */
JPanel messagePanel = new JPanel();
/** Description of the Field */
boolean sim = false;
/** Description of the Field */
Dimension size;
/** Description of the Field */
JPanel userPanel = new JPanel();
/** Description of the Field */
MhTable mhTable;
/** Constructor for the MhClient object */
public MhFrame()
{
addWindowListener(
new WindowAdapter()
{
public void windowClosing(WindowEvent e)
{
destroy();
System.exit(0);
}
});
this.init();
}
/** Description of the Method */
public void destroy()
{
if(mhTable != null)
mhTable.close();
/*
if(!sim)
{
super.destroy();
}
*/
}
/** Description of the Method */
public void init()
{
//super.init();
size = new Dimension(570, 570);
contentPane = (JPanel)this.getContentPane();
contentPane.setLayout(borderLayout1);
Dimension d = messagePanel.getSize();
d.height += 20;
messagePanel.setPreferredSize(d);
contentPane.add(messagePanel, BorderLayout.SOUTH);
contentPane.setOpaque(true);
userPanel.setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.anchor = GridBagConstraints.WEST;
gbc.insets = new Insets(2, 2, 2, 2);
messagePanel.setLayout(borderLayout5);
contentPane.setOpaque(true);
contentPane.setBackground(Color.white);
this.setSize(size);
messagePanel.add(labelMessage, BorderLayout.NORTH);
//Logg.logg("MhClient: Fre XttTree-skapande", 6);
this.mhTable = new MhTable(this, false, this.labelMessage);
//Logg.logg("MhClient: mhTable-skapande klart", 6);
this.contentPane.add(this.mhTable.splitPane, BorderLayout.CENTER);
}
public void setMess(String mess, boolean error)
{
/*
if(error)
{
this.labelMessage.setColor(Color.red);
}
else
{
this.labelMessage.setColor(Color.blue);
}
*/
this.labelMessage.setText(mess);
}
public static void main(String[] args)
{
boolean debug = false;
for(int i = 0; i < args.length; i++)
{
if(args[i].equals("-d") || args[i].equals("-D"))
{
debug = true;
}
}
MhFrame frame = new MhFrame();
frame.pack();
frame.setVisible(true);
}
}
This diff is collapsed.
...@@ -41,6 +41,9 @@ import java.util.*; ...@@ -41,6 +41,9 @@ import java.util.*;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.*; import javax.swing.event.*;
/**
Event log date chooser in serach dialog.
*/
public class HistDateChooser extends JPanel implements ActionListener{ public class HistDateChooser extends JPanel implements ActionListener{
private Calendar date; private Calendar date;
......
...@@ -43,15 +43,18 @@ import javax.swing.table.*; ...@@ -43,15 +43,18 @@ import javax.swing.table.*;
import jpwr.rt.*; import jpwr.rt.*;
import java.applet.Applet; import java.applet.Applet;
/* HistSearch is a search engine for performing searches from the historic /**
*event list. It's mainly a GUI for getting input on the criteria on which * Event log search dialog.
*the search should be based, launching the search and presenting the result. * <p>
*It uses a HistTable called result for presenting the search result. * HistSearch is a search engine for performing searches from the historic
*The HistQuery currentSearch is set to the criteria chosen via the GUI when * event list. It's mainly a GUI for getting input on the criteria on which
*the JButton btnSearch is pressed and currentSearch is then sent to a class * the search should be based, launching the search and presenting the result.
*in the HistTable result for evaluating the search and updating the table. * It uses a HistTable called result for presenting the search result.
*The GUI is made to support English and Swedish by keeping arrays of all * The HistQuery currentSearch is set to the criteria chosen via the GUI when
*strings. * the JButton btnSearch is pressed and currentSearch is then sent to a class
* in the HistTable result for evaluating the search and updating the table.
* The GUI is made to support English and Swedish by keeping arrays of all
* strings.
*/ */
public class HistSearch extends JFrame implements ActionListener, GdhApplIfc { public class HistSearch extends JFrame implements ActionListener, GdhApplIfc {
......
...@@ -42,9 +42,12 @@ import javax.swing.*; ...@@ -42,9 +42,12 @@ import javax.swing.*;
import java.util.Vector; import java.util.Vector;
import jpwr.rt.*; import jpwr.rt.*;
/* The HistSender initiates a socket to the server and can then perform a /**
*SearchRequest given a HistQuery using an ObjectInput- and an * Event log communcation.
*ObjectOutputStream.*/ * The HistSender initiates a socket to the server and can then perform a
* SearchRequest given a HistQuery using an ObjectInput- and an
* ObjectOutputStream.
*/
public class HistSender { public class HistSender {
......
...@@ -39,8 +39,11 @@ import java.util.*; ...@@ -39,8 +39,11 @@ import java.util.*;
import javax.swing.table.AbstractTableModel; import javax.swing.table.AbstractTableModel;
import jpwr.rt.*; import jpwr.rt.*;
/*The HistStatModel1 class is used to derive how many times an Alarm has been /**
set off during the interval of the search provided in a MhData.*/ Event statistics model.
The HistStatModel1 class is used to derive how many times an Alarm has been
set off during the interval of the search provided in a MhData.
*/
public class HistStatModel1 extends AbstractTableModel{ public class HistStatModel1 extends AbstractTableModel{
// The List storing the resulting statistics. // The List storing the resulting statistics.
......
...@@ -40,9 +40,12 @@ import java.util.regex.*; ...@@ -40,9 +40,12 @@ import java.util.regex.*;
import javax.swing.table.AbstractTableModel; import javax.swing.table.AbstractTableModel;
import jpwr.rt.*; import jpwr.rt.*;
/* HistStatModel2 is an AbstractTableModel that derives information on the /**
Event statistics model.
HistStatModel2 is an AbstractTableModel that derives information on the
duration of alarms (Active to Return) supplied in a MhData. Proper methods duration of alarms (Active to Return) supplied in a MhData. Proper methods
for displaying the results as a table ar included aswell... */ for displaying the results as a table ar included aswell...
*/
public class HistStatModel2 extends AbstractTableModel{ public class HistStatModel2 extends AbstractTableModel{
// The List holding the statistics // The List holding the statistics
......
...@@ -41,10 +41,13 @@ import javax.swing.*; ...@@ -41,10 +41,13 @@ import javax.swing.*;
import java.util.Vector; import java.util.Vector;
import jpwr.rt.*; import jpwr.rt.*;
/* The HistStatistics class is a JPanel containing two JTables showing /**
statistics derived from the MhData supplied in the constructor. The tables Event statistics.
get their contents from a HistStatModel1 and an HistStatModel2. The tables support The HistStatistics class is a JPanel containing two JTables showing
the use of JopMethodsMenu.*/ statistics derived from the MhData supplied in the constructor. The tables
get their contents from a HistStatModel1 and an HistStatModel2. The tables support
the use of JopMethodsMenu.
*/
public class HistStatistics extends JPanel{ public class HistStatistics extends JPanel{
......
...@@ -47,10 +47,13 @@ import java.awt.datatransfer.ClipboardOwner; ...@@ -47,10 +47,13 @@ import java.awt.datatransfer.ClipboardOwner;
import java.awt.datatransfer.StringSelection; import java.awt.datatransfer.StringSelection;
import jpwr.rt.*; import jpwr.rt.*;
/* HistTable is an extended JScrollPane containing the /**
* Event log table.
* HistTable is an extended JScrollPane containing the
* a JTable alarmTable. The HistTable also contains methods for exporting * a JTable alarmTable. The HistTable also contains methods for exporting
* the alarmTable to an excel file, and for performing a search in the historic * the alarmTable to an excel file, and for performing a search in the historic
* event list using a HistSender */ * event list using a HistSender
*/
public class HistTable extends JScrollPane { public class HistTable extends JScrollPane {
......
/*
* Proview Open Source Process Control.
* Copyright (C) 2005-2014 SSAB EMEA AB.
*
* This file is part of Proview.
*
* 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 Proview. If not, see <http://www.gnu.org/licenses/>
*
* Linking Proview statically or dynamically with other modules is
* making a combined work based on Proview. Thus, the terms and
* conditions of the GNU General Public License cover the whole
* combination.
*
* In addition, as a special exception, the copyright holders of
* Proview give you permission to, from the build function in the
* Proview Configurator, combine Proview with modules generated by the
* Proview PLC Editor to a PLC program, regardless of the license
* terms of these modules. You may copy and distribute the resulting
* combined work under the terms of your choice, provided that every
* copy of the combined work is accompanied by a complete copy of
* the source code of Proview (the version used to produce the
* combined work), being distributed under the terms of the GNU
* General Public License plus this exception.
*/
package jpwr.jop;
import java.awt.*;
import javax.swing.*;
import java.util.*;
import jpwr.jop.*;
import java.beans.Beans;
/** RatioLayout.java -- Layout manager for Java containers
*
* This layout manager allows you to specify ratios of x,y,width,height
* using a Proportion object.
*
* For example,
*
* setLayout(new RatioLayout());
* add( myObject, new Proportion(myObject.getBounds(), this.getSize()));
*
* @author Mats Trovik inspired by RatioLayout.java by Terence Parr
*
*/
public class RatioLayout implements LayoutManager2 {
// track the ratios for each object of form "xratio,yratio;wratio,hratio"
//Vector<Proportion> ratios = new Vector<Proportion>(1);
Vector ratios = new Vector(1);
// track the components also so we can remove associated modifier
// if necessary.
//Vector<Component> components = new Vector<Component>(1);
Vector components = new Vector(1);
public void addLayoutComponent(String r, Component comp) {
}
// The used method for adding components.
public void addLayoutComponent(Component comp, Object o){
Proportion r = (Proportion) o;
ratios.addElement(r);
components.addElement(comp);
}
//Maximum layout size depends on the target (as opposed to the normal case)
public Dimension maximumLayoutSize(Container target){
return target.getSize();
}
public float getLayoutAlignmentX(Container target){
//The layout is left aligned
return (float) 0.0;
}
public float getLayoutAlignmentY(Container target){
//the layout is top aligned
return (float) 0.0;
}
//Reset the Layout
public void invalidateLayout(Container target){
// This is called more frequently in 1.5...
// ratios = new Vector(1);
//components = new Vector(1);
}
// Remove component from Layout
public void removeLayoutComponent(Component comp) {
int i = components.indexOf(comp);
if ( i!=-1 ) {
ratios.removeElementAt(i);
components.removeElementAt(i);
}
}
public Dimension preferredLayoutSize(Container target) {
return target.getSize();
}
public Dimension minimumLayoutSize(Container target) {
return target.getSize();
}
public void layoutContainer(Container target) {
Insets insets = target.getInsets();
int ncomponents = target.getComponentCount();
Dimension d = target.getSize();
//make sure to not draw over the insets.(Java standard)
d.width -= insets.left+insets.right;
d.height -= insets.top+insets.bottom;
System.out.println( "RatioLayout: width " + d.width + " height " + d.height);
//Layout each component
for (int i = 0 ; i < ncomponents ; i++) {
Component comp = target.getComponent(i);
Proportion compProp;
try {
compProp = (Proportion)ratios.elementAt(i);
}
catch (ArrayIndexOutOfBoundsException e){
break;
}
//Set the width and height according to the ratio specified when
//the component was added.
int w = (int)(d.width*compProp.rw);
int h = (int)(d.height*compProp.rh);
// set x & y to the ratio specified when the component was added.
//These values will be changed if the comonent is a slider or
//a moving GeComponent.
int x = (int) (d.width*compProp.rx);
int y = (int) (d.height*compProp.ry);
if(comp instanceof GeComponent){
GeComponent tempComp= (GeComponent) comp;
//If the component is of type mDynType_Move...
if((tempComp.dd.dynType & GeDyn.mDynType_Move) != 0){
if (compProp.firstDraw){
// ... and it's drawn for the first time, store the
//parent's dimension in Proportion.previous,
compProp.firstDraw=false;
compProp.previous.setSize(d.width,d.height);
}
else{
/*... and it's drawn for at least the 2nd time, the
*place where to draw it is caculated from the ratio
*between the the current dimensions of the parent and
*the previous dimensions (before resize)
*of the parent multiplied with the position of the
*object. Care is taken to only adjust the position in
*the direction(s) specified by the GeDynMove.moveX(Y)Attribute.
*The current dimensions of the parent are stored
*in Proportion.previous.*/
for(int j=0;j<tempComp.dd.elements.length;j++)
{
if(tempComp.dd.elements[j] instanceof GeDynMove){
Rectangle compLoc = comp.getBounds();
if ((! ((GeDynMove)tempComp.dd.elements[j]).moveXAttribute.equals(""))){
double rx = (1.0*d.width /compProp.previous.width );
x = (int) (compLoc.x*rx);
}
if ((! ((GeDynMove)tempComp.dd.elements[j]).moveYAttribute.equals(""))){
double ry = (1.0*d.height/compProp.previous.height);
y = (int) (compLoc.y*ry);
}
}
compProp.previous.setSize(d.width,d.height);
}
}
}
//If the component is a slider...
else if((tempComp.dd.actionType & GeDyn.mActionType_Slider) != 0){
if (compProp.firstDraw){
// ... and it's drawn for the first time, store the
//parent's dimension in Proportion.previous,
compProp.firstDraw=false;
compProp.previous.setSize(d.width,d.height);
}
else{
/*... and it's drawn for at least the 2nd time,
*the direction of the slider is checked.
*The ratio between the target width or height
*(after resize) and the previous width or
*height is used to calculate the position
*fitting the new size. The current dimensions
*of the parent are stored in Proportion.previous.*/
for(int j=0;j<tempComp.dd.elements.length;j++)
{
if(tempComp.dd.elements[j] instanceof GeDynSlider){
Rectangle compLoc = comp.getBounds();
if (
((GeDynSlider)tempComp.dd.elements[j]).direction == Ge.DIRECTION_LEFT
||
((GeDynSlider)tempComp.dd.elements[j]).direction == Ge.DIRECTION_RIGHT){
double rx = (1.0*d.width /compProp.previous.width );
x = (int) (compLoc.x*rx);
}
else if (
((GeDynSlider)tempComp.dd.elements[j]).direction == Ge.DIRECTION_UP
||
((GeDynSlider)tempComp.dd.elements[j]).direction == Ge.DIRECTION_DOWN){
double ry = (1.0*d.height/compProp.previous.height);
y = (int) (compLoc.y*ry);
}
}
}
compProp.previous.setSize(d.width,d.height);
}
}
}
//Place the component.
comp.setBounds(x+insets.left,y+insets.top,w,h);
//Resize the font of JTextFields.
if (comp instanceof JTextField){
comp.setFont(comp.getFont().deriveFont((float)(1.0*h*6/10)));
}
}
}
public String toString() {
return getClass().getName();
}
}
...@@ -35,17 +35,11 @@ ...@@ -35,17 +35,11 @@
*/ */
/**
* Title:
* Description:
* Copyright: Copyright (c) 2000
* Company:
* @author CS
* @version 1.0
*/
package jpwr.jop; package jpwr.jop;
/**
Jop basic definitions.
*/
public class Jop { public class Jop {
public static final int BUTTON_ACTION_SET = 0; public static final int BUTTON_ACTION_SET = 0;
public static final int BUTTON_ACTION_RESET = 1; public static final int BUTTON_ACTION_RESET = 1;
......
...@@ -35,15 +35,6 @@ ...@@ -35,15 +35,6 @@
*/ */
/**
* Title: <p>
* Description: Utöka befintliga JButton till PwrButton.<p>
* Copyright: Copyright (c) <p>
* Company: <p>
* @author
* @version 1.0
*/
package jpwr.jop; package jpwr.jop;
import javax.swing.*; import javax.swing.*;
import java.awt.event.*; import java.awt.event.*;
...@@ -52,6 +43,10 @@ import java.applet.*; ...@@ -52,6 +43,10 @@ import java.applet.*;
import java.net.*; import java.net.*;
import jpwr.rt.*; import jpwr.rt.*;
/**
Jop root object when Jop is started as an applet.
@see JopFrame
*/
public class JopApplet extends JApplet implements GdhApplIfc public class JopApplet extends JApplet implements GdhApplIfc
{ {
public JopSession session; public JopSession session;
......
...@@ -43,6 +43,9 @@ import javax.swing.*; ...@@ -43,6 +43,9 @@ import javax.swing.*;
import java.awt.event.*; import java.awt.event.*;
import jpwr.rt.*; import jpwr.rt.*;
/**
Jop axis component.
*/
public class JopAxis extends JComponent { public class JopAxis extends JComponent {
Dimension size; Dimension size;
public JopAxis() public JopAxis()
......
...@@ -43,6 +43,9 @@ import javax.swing.*; ...@@ -43,6 +43,9 @@ import javax.swing.*;
import java.awt.event.*; import java.awt.event.*;
import jpwr.rt.*; import jpwr.rt.*;
/**
Jop axis arc component.
*/
public class JopAxisarc extends JComponent { public class JopAxisarc extends JComponent {
Dimension size; Dimension size;
public JopAxisarc() public JopAxisarc()
......
...@@ -44,6 +44,9 @@ import javax.swing.Timer; ...@@ -44,6 +44,9 @@ import javax.swing.Timer;
import java.awt.event.*; import java.awt.event.*;
import jpwr.rt.*; import jpwr.rt.*;
/**
Jop bar component.
*/
public class JopBar extends JComponent implements GeComponentIfc, public class JopBar extends JComponent implements GeComponentIfc,
JopDynamic, JopConfirm, ActionListener{ JopDynamic, JopConfirm, ActionListener{
Dimension size; Dimension size;
......
...@@ -44,6 +44,9 @@ import javax.swing.Timer; ...@@ -44,6 +44,9 @@ import javax.swing.Timer;
import java.awt.event.*; import java.awt.event.*;
import jpwr.rt.*; import jpwr.rt.*;
/**
Jop bar chart component.
*/
public class JopBarChart extends JComponent implements GeComponentIfc, public class JopBarChart extends JComponent implements GeComponentIfc,
JopDynamic, JopConfirm, ActionListener{ JopDynamic, JopConfirm, ActionListener{
Dimension size; Dimension size;
......
This diff is collapsed.
...@@ -40,6 +40,9 @@ import java.awt.*; ...@@ -40,6 +40,9 @@ import java.awt.*;
import javax.swing.*; import javax.swing.*;
import java.awt.event.*; import java.awt.event.*;
/**
Jop confirm dialog used by Ge confirm dynamics.
*/
public class JopConfirmDialog { public class JopConfirmDialog {
static JDialog dia = null; static JDialog dia = null;
static Component par; static Component par;
......
...@@ -13,6 +13,9 @@ ...@@ -13,6 +13,9 @@
package jpwr.jop; package jpwr.jop;
/**
Java-based implementation of the unix crypt command
*/
public class JopCrypt public class JopCrypt
{ {
private JopCrypt() {} private JopCrypt() {}
......
...@@ -49,6 +49,9 @@ import javax.swing.border.*; ...@@ -49,6 +49,9 @@ import javax.swing.border.*;
import java.net.URL; import java.net.URL;
import jpwr.rt.*; import jpwr.rt.*;
/**
Jop curve window for trends and fast curves.
*/
public class JopCurve extends JFrame implements GdhApplIfc public class JopCurve extends JFrame implements GdhApplIfc
{ {
......
...@@ -43,6 +43,9 @@ import javax.swing.*; ...@@ -43,6 +43,9 @@ import javax.swing.*;
import java.awt.event.*; import java.awt.event.*;
import jpwr.rt.*; import jpwr.rt.*;
/**
Axis configuration and drawing for the curve window.
*/
public class JopCurveAxis extends JComponent { public class JopCurveAxis extends JComponent {
Dimension size; Dimension size;
public JopCurveAxis() public JopCurveAxis()
......
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