Commit 4e4bfb3e authored by claes's avatar claes

Adapted to java 1.5

parent a7244567
/* /*
* Proview $Id: RatioLayout.java,v 1.5 2006-06-16 05:09:38 claes Exp $ * Proview $Id: RatioLayout.java,v 1.6 2007-01-30 06:53:14 claes Exp $
* Copyright (C) 2005 SSAB Oxelösund AB. * Copyright (C) 2005 SSAB Oxelösund AB.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
...@@ -74,10 +74,9 @@ public class RatioLayout implements LayoutManager2 { ...@@ -74,10 +74,9 @@ public class RatioLayout implements LayoutManager2 {
} }
//Reset the Layout //Reset the Layout
public void invalidateLayout(Container target){ public void invalidateLayout(Container target){
//ratios = new Vector<Proportion>(1); // This is called more frequently in 1.5...
//components = new Vector<Component>(1); // ratios = new Vector(1);
ratios = new Vector(1); //components = new Vector(1);
components = new Vector(1);
} }
...@@ -100,7 +99,6 @@ public class RatioLayout implements LayoutManager2 { ...@@ -100,7 +99,6 @@ public class RatioLayout implements LayoutManager2 {
public void layoutContainer(Container target) { public void layoutContainer(Container target) {
Insets insets = target.getInsets(); Insets insets = target.getInsets();
int ncomponents = target.getComponentCount(); int ncomponents = target.getComponentCount();
Dimension d = target.getSize(); Dimension d = target.getSize();
......
/* /*
* Proview $Id: XttRefObj.java,v 1.2 2005-09-01 14:57:51 claes Exp $ * Proview $Id: XttRefObj.java,v 1.3 2007-01-30 06:53:37 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
...@@ -30,17 +30,17 @@ import jpwr.rt.*; ...@@ -30,17 +30,17 @@ import jpwr.rt.*;
public class XttRefObj extends DynamicObj implements JopDynamic public class XttRefObj extends DynamicObj implements JopDynamic
{ {
/** Description of the Field */ /** Description of the Field */
public XttObjAttr objAttr = null; public XttObjAttr objAttribute = null;
//static JopEngine en; //static JopEngine en;
/** Description of the Field */ /** Description of the Field */
int classid; int cid;
// String showableClassName = null; // String showableClassName = null;
/** Description of the Field */ /** Description of the Field */
String fullName; String fullname;
/** Description of the Field */ /** Description of the Field */
int index; int index;
static boolean initDone = false; static boolean initdone = false;
/** Description of the Field */ /** Description of the Field */
static String[] AttributeNameArray = {"ActualValue", static String[] AttributeNameArray = {"ActualValue",
"ActualValue", "ActualValue",
...@@ -188,18 +188,18 @@ public class XttRefObj extends DynamicObj implements JopDynamic ...@@ -188,18 +188,18 @@ public class XttRefObj extends DynamicObj implements JopDynamic
/** /**
* Constructor for the XttRefObj object * Constructor for the XttRefObj object
* *
*@param fullName Description of the Parameter *@param fullname Description of the Parameter
*@param en Description of the Parameter *@param en Description of the Parameter
*@param classid Description of the Parameter *@param cid Description of the Parameter
*@param treeNode Description of the Parameter *@param treeNode Description of the Parameter
*@param index Description of the Parameter *@param index Description of the Parameter
*/ */
public XttRefObj(String fullName, JopEngine en, int classid, /*String showableClassName,*/DefaultMutableTreeNode treeNode, int index) public XttRefObj(String fullname, JopEngine en, int cid, /*String showableClassName,*/DefaultMutableTreeNode treeNode, int index)
{ {
this.index = index; this.index = index;
this.fullName = fullName; this.fullname = fullname;
this.en = en; XttRefObj.en = en;
this.classid = classid; this.cid = cid;
// this.showableClassName = showableClassName; // this.showableClassName = showableClassName;
if(index < 0) if(index < 0)
{ {
...@@ -210,14 +210,14 @@ public class XttRefObj extends DynamicObj implements JopDynamic ...@@ -210,14 +210,14 @@ public class XttRefObj extends DynamicObj implements JopDynamic
Logg.logg("XttRefObj konstruktor", 6); Logg.logg("XttRefObj konstruktor", 6);
if(oa != null) if(oa != null)
{ {
objAttr = new XttObjAttr(oa); objAttribute = new XttObjAttr(oa);
objAttr.treeNode = treeNode; objAttribute.treeNode = treeNode;
objAttr.showName = false; objAttribute.showName = false;
en.add(this); en.add(this);
} }
else else
{ {
Logg.logg("Kan ej debugga " + fullName + " classid: " + classid + " p index " + index, 0); Logg.logg("Kan ej debugga " + fullname + " cid: " + cid + " p index " + index, 0);
} }
} }
...@@ -229,9 +229,9 @@ public class XttRefObj extends DynamicObj implements JopDynamic ...@@ -229,9 +229,9 @@ public class XttRefObj extends DynamicObj implements JopDynamic
*/ */
public PwrtRefId getPwrtRefId() public PwrtRefId getPwrtRefId()
{ {
if(objAttr != null && objAttr.refObj != null) if(objAttribute != null && objAttribute.refObj != null)
{ {
return objAttr.refObj.refid; return objAttribute.refObj.refid;
} }
return null; return null;
} }
...@@ -248,11 +248,11 @@ public class XttRefObj extends DynamicObj implements JopDynamic ...@@ -248,11 +248,11 @@ public class XttRefObj extends DynamicObj implements JopDynamic
Logg.logg("XttRefObj: getXttObjAttr", 6); Logg.logg("XttRefObj: getXttObjAttr", 6);
String s = null; String s = null;
String suffix; String suffix;
suffix = this.setTypeIdString(objAttr.type, objAttr.size); suffix = this.setTypeIdString(objAttribute.type, objAttribute.size);
s = this.fullName + "." + objAttr.name + suffix; s = this.fullname + "." + objAttribute.name + suffix;
objAttr.fullName = s; objAttribute.fullName = s;
Logg.logg("XttRefObj: Name " + s, 6); Logg.logg("XttRefObj: Name " + s, 6);
return objAttr; return objAttribute;
} }
...@@ -286,7 +286,7 @@ public class XttRefObj extends DynamicObj implements JopDynamic ...@@ -286,7 +286,7 @@ public class XttRefObj extends DynamicObj implements JopDynamic
Logg.logg("XttRefObj: animationOnly", 6); Logg.logg("XttRefObj: animationOnly", 6);
return; return;
} }
this.setObjectAttributeValue(objAttr); this.setObjectAttributeValue(objAttribute);
} }
...@@ -303,9 +303,9 @@ public class XttRefObj extends DynamicObj implements JopDynamic ...@@ -303,9 +303,9 @@ public class XttRefObj extends DynamicObj implements JopDynamic
*/ */
public String toString() public String toString()
{ {
if(objAttr != null) if(objAttribute != null)
{ {
return objAttr.toString(); return objAttribute.toString();
} }
else else
{ {
...@@ -365,14 +365,14 @@ public class XttRefObj extends DynamicObj implements JopDynamic ...@@ -365,14 +365,14 @@ public class XttRefObj extends DynamicObj implements JopDynamic
*/ */
public static void init(JopEngine en) public static void init(JopEngine en)
{ {
if(XttRefObj.initDone) if(XttRefObj.initdone)
return; return;
XttRefObj.en = en; XttRefObj.en = en;
for(int i = 0; i < TypeClassId.length; i++) for(int i = 0; i < TypeClassId.length; i++)
{ {
AttrObj[i] = XttRefObj.getWantedClassAttribute(i); AttrObj[i] = XttRefObj.getWantedClassAttribute(i);
} }
XttRefObj.initDone = true; XttRefObj.initdone = true;
} }
} }
......
/* /*
* Proview $Id: XttTree.java,v 1.12 2006-06-16 05:19:28 claes Exp $ * Proview $Id: XttTree.java,v 1.13 2007-01-30 06:53:37 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
...@@ -246,12 +246,12 @@ public class XttTree extends JPanel ...@@ -246,12 +246,12 @@ public class XttTree extends JPanel
DynamicObj.init(engine); DynamicObj.init(engine);
//get the icons that is for the + and - signs to the left of every node //get the icons that is for the + and - signs to the left of every node
BasicTreeUI ui = (BasicTreeUI)tree.getUI(); BasicTreeUI tui = (BasicTreeUI)tree.getUI();
ImageIcon OpenCloseIcon = new ImageIcon(XttOpenCloseIcon); ImageIcon OpenCloseIcon = new ImageIcon(XttOpenCloseIcon);
ImageIcon OpenIcon = new ImageIcon(XttOpenIcon); ImageIcon OpenIcon = new ImageIcon(XttOpenIcon);
ImageIcon CloseIcon = new ImageIcon(XttCloseIcon); ImageIcon CloseIcon = new ImageIcon(XttCloseIcon);
ui.setCollapsedIcon(OpenIcon); tui.setCollapsedIcon(OpenIcon);
ui.setExpandedIcon(CloseIcon); tui.setExpandedIcon(CloseIcon);
tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); tree.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
...@@ -293,7 +293,7 @@ public class XttTree extends JPanel ...@@ -293,7 +293,7 @@ public class XttTree extends JPanel
xttObj.init(false); xttObj.init(false);
if(xttObj.refObj != null) if(xttObj.refObj != null)
{ {
xttObj.refObj.objAttr.treeModel = this.treeModel; AttrObj.treeModel = this.treeModel;
} }
rootNode.add(tNodeRoot); rootNode.add(tNodeRoot);
if(gdhr.hasChildren) if(gdhr.hasChildren)
...@@ -1712,7 +1712,7 @@ public class XttTree extends JPanel ...@@ -1712,7 +1712,7 @@ public class XttTree extends JPanel
obj.elements); obj.elements);
DefaultMutableTreeNode arrayChildNode = new DefaultMutableTreeNode(arrayAttr); DefaultMutableTreeNode arrayChildNode = new DefaultMutableTreeNode(arrayAttr);
arrayAttr.treeNode = arrayChildNode; arrayAttr.treeNode = arrayChildNode;
arrayAttr.treeModel = obj.treeModel; XttArrayAttr.treeModel = XttObjAttr.treeModel;
obj.treeNode.add(arrayChildNode); obj.treeNode.add(arrayChildNode);
Logg.logg("XttObj: arrayAttr.fullName= " + arrayAttr.fullName, 8); Logg.logg("XttObj: arrayAttr.fullName= " + arrayAttr.fullName, 8);
String str = arrayAttr.fullName; String str = arrayAttr.fullName;
......
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