summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpjain <pjain@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-04-09 19:53:33 +0000
committerpjain <pjain@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1997-04-09 19:53:33 +0000
commitdf1c416bfefd0d49b5e0c9c176f9a54edb71ece2 (patch)
treea662c3182003f014870a7a2bfea61d95365c175d
parentad64c4821cb90b765831af9b9ca58401e5e1d299 (diff)
downloadATCD-df1c416bfefd0d49b5e0c9c176f9a54edb71ece2.tar.gz
Seth changed a few things to allow the gjt component scoller to work with it
-rw-r--r--java/ImageProcessing/framework/Hierarchy.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/java/ImageProcessing/framework/Hierarchy.java b/java/ImageProcessing/framework/Hierarchy.java
index b24ea53b6e3..edab96717e0 100644
--- a/java/ImageProcessing/framework/Hierarchy.java
+++ b/java/ImageProcessing/framework/Hierarchy.java
@@ -57,11 +57,19 @@ public class Hierarchy extends Canvas
public void setExpandable(boolean expandable)
{
deadend_ = ! expandable;
+
+ /*
+ if (root_ != null)
+ root_.repaint();
+ */
}
public void setCollapsed(boolean collapsed)
{
collapsed_ = collapsed;
+
+ if (root_ != null)
+ root_.repaint();
}
public void addEntry(Hierarchy entry)
@@ -156,13 +164,18 @@ public class Hierarchy extends Canvas
return false;
}
-
-
+
public void paint(Graphics g)
{
+ Dimension d = size();
+
drawLevel(g, SPACE, SPACE);
+
+ if (d.width < scope_.width || d.height < scope_.height)
+ resize(scope_.width, scope_.height);
}
+
private Point drawLevel(Graphics g, int x, int y)
{
g.setFont(FONT);
@@ -212,7 +225,7 @@ public class Hierarchy extends Canvas
{
entry = (Hierarchy)contained_.elementAt(i);
place_marker = entry.drawLevel(g, x, y);
- total_width = Math.max(total_width, entry.self_.width + indent);
+ total_width = Math.max(total_width, entry.scope_.width + indent + SPACE);
x = place_marker.x;
y = place_marker.y;
}