Author: bobtarling
Date: 2011-02-13 10:12:44-0800
New Revision: 19034
Removed:
trunk/src/argouml-app/src/org/argouml/uml/ui/ScrollList.java
trunk/src/argouml-app/src/org/argouml/uml/ui/UMLSingleRowSelector.java
Modified:
trunk/src/argouml-app/src/org/argouml/uml/ui/LabelledLayout.java
trunk/src/argouml-app/src/org/argouml/uml/ui/PropPanel.java
Log:
Get rid of ScrollList and SingleRowSelector from old prop panel inplementation
Modified: trunk/src/argouml-app/src/org/argouml/uml/ui/LabelledLayout.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/ui/LabelledLayout.java?view=diff&pathrev=19034&r1=19033&r2=19034
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/ui/LabelledLayout.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/ui/LabelledLayout.java 2011-02-13 10:12:44-0800
@@ -339,9 +339,7 @@
for (int i = 0; i < componentCount; ++i) {
final Component childComp = (Component) components.get(i);
final int childHeight;
- if (childComp instanceof JToolBar && previousComp instanceof ScrollList) {
- // Ignore toolbars belonging to ScrollList
- } else if (childComp instanceof JLabel) {
+ if (childComp instanceof JLabel) {
final JLabel jlabel = (JLabel) childComp;
final Component labelledComp = jlabel.getLabelFor();
@@ -389,58 +387,54 @@
for (int i = 0; i < componentCount; ++i) {
Component childComp = (Component) components.get(i);
if (childComp.isVisible()) {
- if (childComp instanceof JToolBar && previousComp instanceof ScrollList) {
- childComp.setLocation(previousComp.getY(), previousComp.getX() - childComp.getWidth());
- } else {
- int rowHeight;
- int componentWidth = sectionWidth;
- int componentX = sectionX;
- // If the component is a JLabel which has another
- // component assigned then position/size the label and
- // calculate the size of the registered component
- if (childComp instanceof JLabel
- && ((JLabel) childComp).getLabelFor() != null) {
- i++; // Assumes the next child is the labelled component
- final JLabel jlabel = (JLabel) childComp;
- childComp = jlabel.getLabelFor();
- jlabel.setBounds(sectionX, y, labelWidth,
- getPreferredHeight(jlabel));
- componentWidth = sectionWidth - (labelWidth);
- componentX = sectionX + labelWidth;
- }
- rowHeight = rowHeights.get(row).intValue();
- if (rowHeight == 0) {
- try {
- rowHeight = calculateHeight(
- parentHeight,
- totalHeight,
- unknownHeightCount--,
- childComp);
- } catch (ArithmeticException e) {
- String lookAndFeel =
- UIManager.getLookAndFeel().getClass().getName();
- throw new IllegalStateException(
- "Division by zero laying out "
- + childComp.getClass().getName()
- + " on " + parent.getClass().getName()
- + " in section " + sectionNo
- + " using "
- + lookAndFeel,
- e);
- }
- totalHeight += rowHeight;
- }
- // Make sure the component width isn't any greater
- // than its maximum allowed width
- if (childComp.getMaximumSize() != null
- && getMaximumWidth(childComp) < componentWidth) {
- componentWidth = getMaximumWidth(childComp);
+ int rowHeight;
+ int componentWidth = sectionWidth;
+ int componentX = sectionX;
+ // If the component is a JLabel which has another
+ // component assigned then position/size the label and
+ // calculate the size of the registered component
+ if (childComp instanceof JLabel
+ && ((JLabel) childComp).getLabelFor() != null) {
+ i++; // Assumes the next child is the labelled component
+ final JLabel jlabel = (JLabel) childComp;
+ childComp = jlabel.getLabelFor();
+ jlabel.setBounds(sectionX, y, labelWidth,
+ getPreferredHeight(jlabel));
+ componentWidth = sectionWidth - (labelWidth);
+ componentX = sectionX + labelWidth;
+ }
+ rowHeight = rowHeights.get(row).intValue();
+ if (rowHeight == 0) {
+ try {
+ rowHeight = calculateHeight(
+ parentHeight,
+ totalHeight,
+ unknownHeightCount--,
+ childComp);
+ } catch (ArithmeticException e) {
+ String lookAndFeel =
+ UIManager.getLookAndFeel().getClass().getName();
+ throw new IllegalStateException(
+ "Division by zero laying out "
+ + childComp.getClass().getName()
+ + " on " + parent.getClass().getName()
+ + " in section " + sectionNo
+ + " using "
+ + lookAndFeel,
+ e);
}
- childComp.setBounds(componentX, y, componentWidth, rowHeight);
- y += rowHeight + this.vgap;
- ++row;
- previousComp = childComp;
+ totalHeight += rowHeight;
+ }
+ // Make sure the component width isn't any greater
+ // than its maximum allowed width
+ if (childComp.getMaximumSize() != null
+ && getMaximumWidth(childComp) < componentWidth) {
+ componentWidth = getMaximumWidth(childComp);
}
+ childComp.setBounds(componentX, y, componentWidth, rowHeight);
+ y += rowHeight + this.vgap;
+ ++row;
+ previousComp = childComp;
}
}
}
Modified: trunk/src/argouml-app/src/org/argouml/uml/ui/PropPanel.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/ui/PropPanel.java?view=diff&pathrev=19034&r1=19033&r2=19034
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/ui/PropPanel.java (original)
+++ trunk/src/argouml-app/src/org/argouml/uml/ui/PropPanel.java 2011-02-13 10:12:44-0800
@@ -728,15 +728,4 @@
public void componentResized(ComponentEvent e) {
// ignored
}
-
- /**
- * Create a single row scroll pane backed by a ListModel.
- *
- * @param model the ListModel to be used to back the scroll pane
- * @return a scrollpane with a single row
- */
- protected UMLSingleRowSelector getSingleRowScroll(ListModel model) {
- UMLSingleRowSelector pane = new UMLSingleRowSelector(model);
- return pane;
- }
}
Removed: trunk/src/argouml-app/src/org/argouml/uml/ui/ScrollList.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/ui/ScrollList.java?view=markup&pathrev=19033
Removed: trunk/src/argouml-app/src/org/argouml/uml/ui/UMLSingleRowSelector.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/ui/UMLSingleRowSelector.java?view=markup&pathrev=19033
------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=2703707
To unsubscribe from this discussion, e-mail: [[email protected]].
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.