Revision: 2441
http://sourceforge.net/p/swingme/code/2441
Author: yuranet
Date: 2021-05-03 17:18:21 +0000 (Mon, 03 May 2021)
Log Message:
-----------
removed unused method
Modified Paths:
--------------
SwingME/lib/UtilME.jar
SwingME/src/net/yura/mobile/gui/DesktopPane.java
SwingME/src/net/yura/mobile/gui/components/ComboBox.java
SwingME/src/net/yura/mobile/gui/components/Component.java
SwingME/src/net/yura/mobile/gui/components/Frame.java
SwingME/src/net/yura/mobile/gui/components/List.java
SwingME/src/net/yura/mobile/gui/components/MenuBar.java
SwingME/src/net/yura/mobile/gui/components/OptionPane.java
SwingME/src/net/yura/mobile/gui/components/Table.java
SwingME/src/net/yura/mobile/gui/components/Window.java
SwingME/src/net/yura/mobile/gui/layout/BorderLayout.java
SwingME/src/net/yura/mobile/gui/layout/BoxLayout.java
SwingME/src/net/yura/mobile/gui/layout/FlowLayout.java
SwingME/src/net/yura/mobile/gui/layout/GridBagLayout.java
SwingME/src/net/yura/mobile/gui/layout/GridLayout.java
Modified: SwingME/lib/UtilME.jar
===================================================================
(Binary files differ)
Modified: SwingME/src/net/yura/mobile/gui/DesktopPane.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/DesktopPane.java 2021-04-26 11:11:31 UTC (rev 2440)
+++ SwingME/src/net/yura/mobile/gui/DesktopPane.java 2021-05-03 17:18:21 UTC (rev 2441)
@@ -1586,10 +1586,10 @@
int w = indicator.getWidthWithBorder();
int h = indicator.getHeightWithBorder();
if (sideSoftKeys) {
- indicator.setBoundsWithBorder(0, getHeight() - h, w, h);
+ indicator.setBounds(0, getHeight() - h, w, h);
}
else {
- indicator.setBoundsWithBorder( (Midlet.getPlatform() == Midlet.PLATFORM_SONY_ERICSSON) ?0:(getWidth()-w), 0, w, h);
+ indicator.setBounds( (Midlet.getPlatform() == Midlet.PLATFORM_SONY_ERICSSON) ?0:(getWidth()-w), 0, w, h);
}
}
}
@@ -1665,7 +1665,7 @@
Border insets = window.getInsets();
if (top && bottom) {
- window.setBoundsWithBorder(window.getXWithBorder(),0, window.getWidthWithBorder(),h);
+ window.setBounds(window.getXWithBorder(),0, window.getWidthWithBorder(),h);
}
else if (top || bottom) {
window.setLocation(window.getX(), top?insets.getTop():h-window.getHeight()-insets.getBottom() );
@@ -1672,7 +1672,7 @@
}
if (left && right) {
- window.setBoundsWithBorder(0, window.getYWithBorder(), w, window.getHeightWithBorder());
+ window.setBounds(0, window.getYWithBorder(), w, window.getHeightWithBorder());
}
else if (left || right) {
window.setLocation(left?insets.getLeft():w-window.getWidth()-insets.getRight(), window.getY() );
Modified: SwingME/src/net/yura/mobile/gui/components/ComboBox.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/components/ComboBox.java 2021-04-26 11:11:31 UTC (rev 2440)
+++ SwingME/src/net/yura/mobile/gui/components/ComboBox.java 2021-05-03 17:18:21 UTC (rev 2441)
@@ -142,7 +142,7 @@
Menu.setupSize(dropDown);
if (dropDown.getWidthWithBorder()<getWidthWithBorder()) {
- dropDown.setBoundsWithBorder(0, 0, getWidthWithBorder(), dropDown.getHeightWithBorder());
+ dropDown.setBounds(0, 0, getWidthWithBorder(), dropDown.getHeightWithBorder());
}
Menu.positionMenuRelativeTo(
Modified: SwingME/src/net/yura/mobile/gui/components/Component.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/components/Component.java 2021-04-26 11:11:31 UTC (rev 2440)
+++ SwingME/src/net/yura/mobile/gui/components/Component.java 2021-05-03 17:18:21 UTC (rev 2441)
@@ -320,10 +320,35 @@
}
/**
+ * @see java.awt.Component#setSize(int, int) Component.setSize
+ */
+ public void setSize(int width, int height) {
+ this.width = width;
+ this.height = height;
+ }
+
+ /**
+ * @see java.awt.Component#setLocation(int, int) Component.setLocation
+ */
+ public void setLocation(int posX, int posY) {
+ this.posX = posX;
+ this.posY = posY;
+ }
+
+ /**
+ * @see java.awt.Component#setBounds(int, int, int, int) Component.setBounds
+ */
+ public void setBounds(int x, int y, int w, int h) {
+ Border insets = getInsets();
+ setLocation(x + insets.getLeft(), y + insets.getTop());
+ setSize(w - (insets.getRight() + insets.getLeft()), h - (insets.getTop() + insets.getBottom()));
+ }
+
+ /**
* @return the current x coordinate of the component's origin
* @see javax.swing.JComponent#getX() JComponent.getX
*/
- public int getX(){
+ public int getX() {
return posX;
}
@@ -331,7 +356,7 @@
* @return the current y coordinate of the component's origin
* @see javax.swing.JComponent#getY() JComponent.getY
*/
- public int getY(){
+ public int getY() {
return posY;
}
/**
@@ -338,7 +363,7 @@
* @return the current width of this component
* @see javax.swing.JComponent#getWidth() JComponent.getWidth
*/
- public int getWidth(){
+ public int getWidth() {
return width;
}
/**
@@ -345,34 +370,33 @@
* @return the current height of this component
* @see javax.swing.JComponent#getHeight() JComponent.getHeight
*/
- public int getHeight(){
+ public int getHeight() {
return height;
}
/**
- * @see java.awt.Component#setBounds(int, int, int, int) Component.setBounds
+ * @see java.awt.Component#getLocation()
+ * @see java.awt.Component#getX()
*/
- public void setBounds(int posX, int posY, int width, int height) {
- setLocation(posX,posY);
- setSize(width,height);
+ public int getXWithBorder() {
+ Border insets = getInsets();
+ return getX() - insets.getLeft();
}
+ public int getYWithBorder() {
+ Border insets = getInsets();
+ return getY() - insets.getTop();
+ }
- /**
- * @see java.awt.Component#setSize(int, int) Component.setSize
- */
- public void setSize(int width, int height){
- this.width = width;
- this.height = height;
+ public int getWidthWithBorder() {
+ Border insets = getInsets();
+ return getWidth() + insets.getRight() + insets.getLeft();
}
+ public int getHeightWithBorder() {
+ Border insets = getInsets();
+ return getHeight() + insets.getTop() + insets.getBottom();
+ }
/**
- * @see java.awt.Component#setLocation(int, int) Component.setLocation
- */
- public void setLocation(int posX, int posY){
- this.posX = posX;
- this.posY = posY;
- }
- /**
* override and call super when things HAVE to be painted
* @see java.awt.Component#paint(java.awt.Graphics) Component.paint
*/
@@ -394,16 +418,16 @@
* @see javax.swing.JComponent#paintBorder(java.awt.Graphics) JComponent.paintBorder
*/
protected void paintBorder(Graphics2D g) {
-
Border b = getBorder();
if (b != null) {
b.paintBorder(this, g,width,height);
}
-
}
public final static Border empty = new EmptyBorder(0, 0, 0, 0);
+
/**
+ * @see java.awt.Container#getInsets()
* @see javax.swing.JComponent#getInsets() JComponent.getInsets
*/
public Border getInsets() {
@@ -567,7 +591,6 @@
if (preferredHeight!=-1) {
height = preferredHeight;
}
-
}
/**
@@ -575,9 +598,7 @@
* @see javax.swing.JComponent#setBackground(java.awt.Color) JComponent.setBackground
*/
public void setBackground(int a) {
-
background = a;
-
}
/**
@@ -627,34 +648,6 @@
this.border = border;
}
- public int getWidthWithBorder() {
- Border insets = getInsets();
- return getWidth() + insets.getRight() + insets.getLeft();
- }
- public int getHeightWithBorder() {
- Border insets = getInsets();
- return getHeight() + insets.getTop() + insets.getBottom();
- }
-
- public int getXWithBorder() {
- Border insets = getInsets();
- return getX() - insets.getLeft();
- }
- public int getYWithBorder() {
- Border insets = getInsets();
- return getY() - insets.getTop();
- }
-
- public void setBoundsWithBorder(int x,int y,int w,int h) {
- Border insets = getInsets();
- setBounds(
- x + insets.getLeft(),
- y + insets.getTop(),
- w - ( insets.getRight() + insets.getLeft() ),
- h - ( insets.getTop() + insets.getBottom() )
- );
- }
-
/**
* @see java.awt.Component#getLocationOnScreen() Component.getLocationOnScreen
*/
Modified: SwingME/src/net/yura/mobile/gui/components/Frame.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/components/Frame.java 2021-04-26 11:11:31 UTC (rev 2440)
+++ SwingME/src/net/yura/mobile/gui/components/Frame.java 2021-05-03 17:18:21 UTC (rev 2441)
@@ -253,7 +253,7 @@
int th=0;
if (titleBar!=null && titleBar.isVisible()) {
th = titleBar.getHeightWithBorder();
- titleBar.setBoundsWithBorder(0, 0, width, th);
+ titleBar.setBounds(0, 0, width, th);
}
boolean bottom = isMaximum && getDesktopPane().SOFT_KEYS;
@@ -270,12 +270,12 @@
}
if (menubar!=null && menubar.isVisible()) {
- menubar.setBoundsWithBorder(0, bottom?height-mh:th, width,mh );
+ menubar.setBounds(0, bottom?height-mh:th, width,mh );
}
Panel contentPane = getContentPane();
if (contentPane!=null && contentPane.isVisible()) {
- contentPane.setBoundsWithBorder(0, th+(bottom?0:mh), width, height -th -mh );
+ contentPane.setBounds(0, th+(bottom?0:mh), width, height -th -mh );
}
}
Modified: SwingME/src/net/yura/mobile/gui/components/List.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/components/List.java 2021-04-26 11:11:31 UTC (rev 2440)
+++ SwingME/src/net/yura/mobile/gui/components/List.java 2021-05-03 17:18:21 UTC (rev 2441)
@@ -504,7 +504,7 @@
int w = fixedCellWidth!=-1?fixedCellWidth:c.getWidthWithBorder();
int h = fixedCellHeight!=-1?fixedCellHeight:c.getHeightWithBorder();
- c.setBoundsWithBorder(
+ c.setBounds(
((layoutOrientation==HORIZONTAL)?offset:0),
((layoutOrientation==HORIZONTAL)?0:offset),
((layoutOrientation==HORIZONTAL)?w:width),
@@ -902,10 +902,10 @@
offset += layoutOrientation == HORIZONTAL ? p.posY : p.posX;
p = p.parent;
} // TODO take into accountthe viewPortX and viewPortY
-
+
if (layoutOrientation == HORIZONTAL) {
scrollRectToVisible( pos, -offset, size, 1, false);
- }
+ }
else {
scrollRectToVisible( -offset, pos, 1, size, false);
}
Modified: SwingME/src/net/yura/mobile/gui/components/MenuBar.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/components/MenuBar.java 2021-04-26 11:11:31 UTC (rev 2440)
+++ SwingME/src/net/yura/mobile/gui/components/MenuBar.java 2021-05-03 17:18:21 UTC (rev 2441)
@@ -149,7 +149,7 @@
if (index >= 0) {
Button button = (Button)getElementAt(index);
Component comp = getRendererComponentFor( index );
- button.setBoundsWithBorder(comp.getXWithBorder(), comp.getYWithBorder(), comp.getWidthWithBorder(), comp.getHeightWithBorder());
+ button.setBounds(comp.getXWithBorder(), comp.getYWithBorder(), comp.getWidthWithBorder(), comp.getHeightWithBorder());
if (!(button instanceof Menu)) {
actionPerformed(Frame.CMD_CLOSE);
}
@@ -192,7 +192,7 @@
if (button.getMnemonic() == mnu) {
if (button.isVisible()) {
Component comp = getRendererComponentFor( indexOf(button) ); // we need pass the visible index, not the index in the Vector
- button.setBoundsWithBorder(comp.getXWithBorder(), comp.getYWithBorder(), comp.getWidthWithBorder(), comp.getHeightWithBorder());
+ button.setBounds(comp.getXWithBorder(), comp.getYWithBorder(), comp.getWidthWithBorder(), comp.getHeightWithBorder());
}
return button;
}
@@ -341,7 +341,7 @@
final int widthMinusDiv = (i==(mycols-1)) ? (getWidth() - w*i) : (w - getDividerWidth() );
final int heightMinusDiv = h - getDividerHeight();
- c.setBoundsWithBorder(w*i, ypos, widthMinusDiv, heightMinusDiv);
+ c.setBounds(w*i, ypos, widthMinusDiv, heightMinusDiv);
}
return c;
Modified: SwingME/src/net/yura/mobile/gui/components/OptionPane.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/components/OptionPane.java 2021-04-26 11:11:31 UTC (rev 2440)
+++ SwingME/src/net/yura/mobile/gui/components/OptionPane.java 2021-05-03 17:18:21 UTC (rev 2441)
@@ -376,11 +376,11 @@
if (getHeightWithBorder() > maxh) {
setFocusedComponent(null);
- setBoundsWithBorder(0,0,getWidthWithBorder() + scroll.getBarThickness(), maxh);
+ setBounds(0,0,getWidthWithBorder() + scroll.getBarThickness(), maxh);
}
if (getWidthWithBorder() > maxw) {
setFocusedComponent(null);
- setBoundsWithBorder(0,0,maxw, getHeightWithBorder() +((getHeightWithBorder() == maxh)?0:scroll.getBarThickness()) );
+ setBounds(0,0,maxw, getHeightWithBorder() +((getHeightWithBorder() == maxh)?0:scroll.getBarThickness()) );
}
getMostRecentFocusOwner();
Modified: SwingME/src/net/yura/mobile/gui/components/Table.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/components/Table.java 2021-04-26 11:11:31 UTC (rev 2440)
+++ SwingME/src/net/yura/mobile/gui/components/Table.java 2021-05-03 17:18:21 UTC (rev 2441)
@@ -408,7 +408,7 @@
Component comp = prepareRenderer(r,c);
if (comp!=null) {
- comp.setBoundsWithBorder(x+his, y+his, currentColWidth-intercellSpacing, currentRowHeight-intercellSpacing);
+ comp.setBounds(x+his, y+his, currentColWidth-intercellSpacing, currentRowHeight-intercellSpacing);
int xoff=comp.getX();
int yoff=comp.getY();
@@ -497,7 +497,7 @@
int y=getCellY(editingRow);
int currentRowHeight=getRowHeight(editingRow);
int currentColWidth=getColumnWidth(editingColumn);
- editorComp.setBoundsWithBorder(x+intercellSpacing/2, y+intercellSpacing/2, currentColWidth-intercellSpacing, currentRowHeight-intercellSpacing );
+ editorComp.setBounds(x+intercellSpacing/2, y+intercellSpacing/2, currentColWidth-intercellSpacing, currentRowHeight-intercellSpacing );
}
}
Modified: SwingME/src/net/yura/mobile/gui/components/Window.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/components/Window.java 2021-04-26 11:11:31 UTC (rev 2440)
+++ SwingME/src/net/yura/mobile/gui/components/Window.java 2021-05-03 17:18:21 UTC (rev 2441)
@@ -430,7 +430,7 @@
// Not a softkey... will be at 0,0. throw exception?
}
- component.setBoundsWithBorder(x, y, componentWidth, componentHeight);
+ component.setBounds(x, y, componentWidth, componentHeight);
return component;
@@ -514,11 +514,11 @@
Button b = getSoftkeyForMnemonic(mn);
if (b!=null && !b.isVisible() && getDesktopPane().SOFT_KEYS) {
Component comp = getRendererComponentOnScreen(b);
- b.setBoundsWithBorder(comp.getXWithBorder(), comp.getYWithBorder(), comp.getWidthWithBorder(), comp.getHeightWithBorder());
+ b.setBounds(comp.getXWithBorder(), comp.getYWithBorder(), comp.getWidthWithBorder(), comp.getHeightWithBorder());
}
if (b!=null && !b.isVisible() && getDesktopPane().HIDDEN_MENU) {
- b.setBoundsWithBorder(0, getDesktopPane().getHeight(), getDesktopPane().getWidth(), b.getHeightWithBorder());
+ b.setBounds(0, getDesktopPane().getHeight(), getDesktopPane().getWidth(), b.getHeightWithBorder());
}
return b;
Modified: SwingME/src/net/yura/mobile/gui/layout/BorderLayout.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/layout/BorderLayout.java 2021-04-26 11:11:31 UTC (rev 2440)
+++ SwingME/src/net/yura/mobile/gui/layout/BorderLayout.java 2021-05-03 17:18:21 UTC (rev 2441)
@@ -83,19 +83,19 @@
switch (p) {
case Graphics.TOP:
- comp.setBoundsWithBorder(0, 0, width, top);
+ comp.setBounds(0, 0, width, top);
break;
case Graphics.BOTTOM:
- comp.setBoundsWithBorder(0, height-bottom, width, bottom);
+ comp.setBounds(0, height-bottom, width, bottom);
break;
case Graphics.RIGHT:
- comp.setBoundsWithBorder(width-right, top, right, height-top-bottom);
+ comp.setBounds(width-right, top, right, height-top-bottom);
break;
case Graphics.LEFT:
- comp.setBoundsWithBorder(0, top, left, height-top-bottom);
+ comp.setBounds(0, top, left, height-top-bottom);
break;
default:
- comp.setBoundsWithBorder(left, top, width-right-left, height-top-bottom);
+ comp.setBounds(left, top, width-right-left, height-top-bottom);
break;
}
Modified: SwingME/src/net/yura/mobile/gui/layout/BoxLayout.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/layout/BoxLayout.java 2021-04-26 11:11:31 UTC (rev 2440)
+++ SwingME/src/net/yura/mobile/gui/layout/BoxLayout.java 2021-05-03 17:18:21 UTC (rev 2441)
@@ -52,7 +52,7 @@
for (int c=0;c<components.size();c++) {
Component comp = (Component)components.elementAt(c);
if (comp.isVisible()) {
- comp.setBoundsWithBorder((axis==Graphics.HCENTER)?offset:0 , (axis==Graphics.HCENTER)?0:offset, (axis==Graphics.HCENTER)?comp.getWidthWithBorder():width, (axis==Graphics.HCENTER)?height:comp.getHeightWithBorder() );
+ comp.setBounds((axis==Graphics.HCENTER)?offset:0 , (axis==Graphics.HCENTER)?0:offset, (axis==Graphics.HCENTER)?comp.getWidthWithBorder():width, (axis==Graphics.HCENTER)?height:comp.getHeightWithBorder() );
offset = offset + ((axis==Graphics.HCENTER)?comp.getWidthWithBorder():comp.getHeightWithBorder());
}
}
Modified: SwingME/src/net/yura/mobile/gui/layout/FlowLayout.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/layout/FlowLayout.java 2021-04-26 11:11:31 UTC (rev 2440)
+++ SwingME/src/net/yura/mobile/gui/layout/FlowLayout.java 2021-05-03 17:18:21 UTC (rev 2441)
@@ -110,7 +110,7 @@
cwidth = comp.getWidthWithBorder();
}
- comp.setBoundsWithBorder(offset , (height-comp.getHeightWithBorder())/2, cwidth, comp.getHeightWithBorder() );
+ comp.setBounds(offset , (height-comp.getHeightWithBorder())/2, cwidth, comp.getHeightWithBorder() );
offset = offset + comp.getWidthWithBorder() + padding;
}
}
@@ -144,7 +144,7 @@
}
int offset = (width - cwidth)/2;
- comp.setBoundsWithBorder(offset,down, cwidth, cheight );
+ comp.setBounds(offset,down, cwidth, cheight );
if (cheight!=0) {
down = down + cheight + padding;
Modified: SwingME/src/net/yura/mobile/gui/layout/GridBagLayout.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/layout/GridBagLayout.java 2021-04-26 11:11:31 UTC (rev 2440)
+++ SwingME/src/net/yura/mobile/gui/layout/GridBagLayout.java 2021-05-03 17:18:21 UTC (rev 2441)
@@ -374,7 +374,7 @@
}
//setRectangle(comp, "bounds", ix, iy, iwidth, iheight);
// Logger.debug("Setting "+subComponent.getName()+" = "+iwidth);
- subComponent.setBoundsWithBorder(ix, iy, iwidth, iheight);
+ subComponent.setBounds(ix, iy, iwidth, iheight);
//doLayout(comp);
i++;
}
Modified: SwingME/src/net/yura/mobile/gui/layout/GridLayout.java
===================================================================
--- SwingME/src/net/yura/mobile/gui/layout/GridLayout.java 2021-04-26 11:11:31 UTC (rev 2440)
+++ SwingME/src/net/yura/mobile/gui/layout/GridLayout.java 2021-05-03 17:18:21 UTC (rev 2441)
@@ -76,7 +76,7 @@
for (int i=0;i<components.size();i++) {
Component comp = (Component)components.elementAt(i);
if (comp.isVisible()) {
- comp.setBoundsWithBorder((a*cwidth)+padding+(padding*a), (d*cheight)+padding+(padding*d), cwidth, cheight);
+ comp.setBounds((a*cwidth)+padding+(padding*a), (d*cheight)+padding+(padding*d), cwidth, cheight);
a++;
// when it gets to the end of the row it adds 1
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|