OSDN Git Service

[fixed] issue 477
authorbadlogicgames <badlogicgames@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Sun, 25 Sep 2011 05:03:12 +0000 (05:03 +0000)
committerbadlogicgames <badlogicgames@6c4fd544-2939-11df-bb46-9574ba5d0bfa>
Sun, 25 Sep 2011 05:03:12 +0000 (05:03 +0000)
12 files changed:
gdx/src/com/badlogic/gdx/scenes/scene2d/ui/Button.java
gdx/src/com/badlogic/gdx/scenes/scene2d/ui/CheckBox.java
gdx/src/com/badlogic/gdx/scenes/scene2d/ui/ComboBox.java
gdx/src/com/badlogic/gdx/scenes/scene2d/ui/FlickScrollPane.java
gdx/src/com/badlogic/gdx/scenes/scene2d/ui/Image.java
gdx/src/com/badlogic/gdx/scenes/scene2d/ui/Label.java
gdx/src/com/badlogic/gdx/scenes/scene2d/ui/List.java
gdx/src/com/badlogic/gdx/scenes/scene2d/ui/ScrollPane.java
gdx/src/com/badlogic/gdx/scenes/scene2d/ui/Slider.java
gdx/src/com/badlogic/gdx/scenes/scene2d/ui/SplitPane.java
gdx/src/com/badlogic/gdx/scenes/scene2d/ui/TextField.java
gdx/src/com/badlogic/gdx/scenes/scene2d/ui/Window.java

index 577b0e2..4891b5f 100644 (file)
@@ -14,7 +14,7 @@ public class Button extends Table {
        public ButtonStyle style;\r
        public boolean isChecked;\r
 \r
-       ClickListener listener;\r
+       protected ClickListener listener;\r
 \r
        public Button (Skin skin) {\r
                this(skin.getStyle(ButtonStyle.class), null);\r
index 8940de4..837ea37 100644 (file)
@@ -6,7 +6,7 @@ import com.badlogic.gdx.graphics.g2d.BitmapFont;
 import com.badlogic.gdx.graphics.g2d.TextureRegion;\r
 \r
 public class CheckBox extends Button {\r
-       private Image image;\r
+       protected Image image;\r
 \r
        public CheckBox (String text, CheckBoxStyle style) {\r
                this(text, style, null);\r
index 54e6bc8..9a19abc 100644 (file)
@@ -81,15 +81,15 @@ import com.badlogic.gdx.scenes.scene2d.ui.utils.ScissorStack;
  * \r
  * @author mzechner */\r
 public class ComboBox extends Widget {\r
-       final Stage stage;\r
-       ComboBoxStyle style;\r
-       String[] items;\r
-       int selection = 0;\r
-       final TextBounds bounds = new TextBounds();\r
-       final Vector2 screenCoords = new Vector2();\r
-       ComboList list = null;\r
-       SelectionListener listener;\r
-       private float prefWidth, prefHeight;\r
+       protected final Stage stage;\r
+       protected ComboBoxStyle style;\r
+       protected String[] items;\r
+       protected int selection = 0;\r
+       protected final TextBounds bounds = new TextBounds();\r
+       protected final Vector2 screenCoords = new Vector2();\r
+       protected ComboList list = null;\r
+       protected SelectionListener listener;\r
+       protected float prefWidth, prefHeight;\r
 \r
        public ComboBox (String[] items, Stage stage, Skin skin) {\r
                this(items, stage, skin.getStyle(ComboBoxStyle.class), null);\r
index 9b5dd37..4fe57c8 100644 (file)
@@ -31,19 +31,19 @@ import com.badlogic.gdx.scenes.scene2d.ui.utils.ScissorStack;
 /** @author Nathan Sweet\r
  * @author mzechner */\r
 public class FlickScrollPane extends Group implements Layout {\r
-       private final Stage stage;\r
-       private Actor widget;\r
+       protected final Stage stage;\r
+       protected Actor widget;\r
        protected boolean needsLayout;\r
 \r
-       private final Rectangle widgetAreaBounds = new Rectangle();\r
-       private final Rectangle scissorBounds = new Rectangle();\r
-       private GestureDetector gestureDetector;\r
+       protected final Rectangle widgetAreaBounds = new Rectangle();\r
+       protected final Rectangle scissorBounds = new Rectangle();\r
+       protected GestureDetector gestureDetector;\r
 \r
-       private boolean scrollX, scrollY;\r
-       float amountX, amountY;\r
-       private float maxX, maxY;\r
-       float velocityX, velocityY;\r
-       float flingTimer;\r
+       protected boolean scrollX, scrollY;\r
+       protected float amountX, amountY;\r
+       protected float maxX, maxY;\r
+       protected float velocityX, velocityY;\r
+       protected float flingTimer;\r
 \r
        public boolean bounces = true;\r
        public float flingTime = 1f;\r
index 8be72b6..947417e 100644 (file)
@@ -7,9 +7,9 @@ import com.badlogic.gdx.graphics.g2d.TextureRegion;
 \r
 public class Image extends Widget {\r
        protected TextureRegion region;\r
-       private NinePatch patch;\r
-       private final Scaling scaling;\r
-       private int align = Align.CENTER;\r
+       protected NinePatch patch;\r
+       protected final Scaling scaling;\r
+       protected int align = Align.CENTER;\r
        protected float imageX, imageY, imageWidth, imageHeight;\r
 \r
        public Image (TextureRegion region) {\r
index a293f88..2b53917 100644 (file)
@@ -55,10 +55,10 @@ import com.badlogic.gdx.scenes.scene2d.Actor;
  * \r
  * @author mzechner */\r
 public class Label extends Widget {\r
-       LabelStyle style;\r
-       BitmapFontCache cache;\r
-       String text;\r
-       private float prefWidth, prefHeight;\r
+       protected LabelStyle style;\r
+       protected BitmapFontCache cache;\r
+       protected String text;\r
+       protected float prefWidth, prefHeight;\r
 \r
        public Label (String text, Skin skin) {\r
                this(text, skin.getStyle(LabelStyle.class), null);\r
index 655aac8..11efea0 100644 (file)
@@ -64,14 +64,14 @@ import com.badlogic.gdx.utils.GdxRuntimeException;
  * \r
  * @author mzechner */\r
 public class List extends Widget {\r
-       ListStyle style;\r
-       String[] items;\r
-       float itemHeight = 0;\r
-       float textOffsetX = 0;\r
-       float textOffsetY = 0;\r
-       int selected = 0;\r
-       SelectionListener listener;\r
-       private float prefWidth, prefHeight;\r
+       protected ListStyle style;\r
+       protected String[] items;\r
+       protected float itemHeight = 0;\r
+       protected float textOffsetX = 0;\r
+       protected float textOffsetY = 0;\r
+       protected int selected = 0;\r
+       protected SelectionListener listener;\r
+       protected float prefWidth, prefHeight;\r
 \r
        public List (String[] items, Skin skin) {\r
                this(items, skin.getStyle(ListStyle.class), null);\r
index c6efc2c..eca81c3 100644 (file)
@@ -85,24 +85,24 @@ import com.badlogic.gdx.scenes.scene2d.ui.utils.ScissorStack;
  * \r
  * @author mzechner */\r
 public class ScrollPane extends Group implements Layout {\r
-       final ScrollPaneStyle style;\r
-       Actor widget;\r
-       Stage stage;\r
-\r
-       Rectangle hScrollBounds = new Rectangle();\r
-       Rectangle vScrollBounds = new Rectangle();\r
-       Rectangle hScrollKnobBounds = new Rectangle();\r
-       Rectangle vScrollKnobBounds = new Rectangle();\r
-       Rectangle widgetAreaBounds = new Rectangle();\r
-       Rectangle scissorBounds = new Rectangle();\r
-\r
-       float hScrollAmount = 0;\r
-       float vScrollAmount = 0;\r
-       boolean hasHScroll = false;\r
-       boolean hasVScroll = false;\r
-       boolean touchScrollH = false;\r
-       boolean touchScrollV = false;\r
-       Vector2 lastPoint = new Vector2();\r
+       protected final ScrollPaneStyle style;\r
+       protected Actor widget;\r
+       protected Stage stage;\r
+\r
+       protected Rectangle hScrollBounds = new Rectangle();\r
+       protected Rectangle vScrollBounds = new Rectangle();\r
+       protected Rectangle hScrollKnobBounds = new Rectangle();\r
+       protected Rectangle vScrollKnobBounds = new Rectangle();\r
+       protected Rectangle widgetAreaBounds = new Rectangle();\r
+       protected Rectangle scissorBounds = new Rectangle();\r
+\r
+       protected float hScrollAmount = 0;\r
+       protected float vScrollAmount = 0;\r
+       protected boolean hasHScroll = false;\r
+       protected boolean hasVScroll = false;\r
+       protected boolean touchScrollH = false;\r
+       protected boolean touchScrollV = false;\r
+       protected Vector2 lastPoint = new Vector2();\r
 \r
        public ScrollPane (Actor widget, Stage stage, Skin skin) {\r
                this(widget, stage, skin.getStyle(ScrollPaneStyle.class), null);\r
index d61f377..195ad79 100644 (file)
@@ -56,13 +56,13 @@ import com.badlogic.gdx.scenes.scene2d.Actor;
  * \r
  * @author mzechner */\r
 public class Slider extends Widget {\r
-       SliderStyle style;\r
-       float min;\r
-       float max;\r
-       float steps;\r
-       float value;\r
-       float sliderPos;\r
-       ValueChangedListener listener = null;\r
+       protected SliderStyle style;\r
+       protected float min;\r
+       protected float max;\r
+       protected float steps;\r
+       protected float value;\r
+       protected float sliderPos;\r
+       protected ValueChangedListener listener = null;\r
 \r
        public Slider (float min, float max, float steps, Skin skin) {\r
                this(min, max, steps, skin.getStyle(SliderStyle.class), null);\r
index 2223146..22f9121 100644 (file)
@@ -75,23 +75,23 @@ import com.badlogic.gdx.utils.GdxRuntimeException;
  * </ul>\r
  * @author mzechner */\r
 public class SplitPane extends Group implements Layout {\r
-       SplitPaneStyle style;\r
-\r
-       boolean invalidated = false;\r
-\r
-       boolean vertical;\r
-       float splitAmount = 0.5f;\r
-       float minAmount = 0;\r
-       float maxAmount = 1;\r
-       float oldSplitAmount = 0;\r
-       Stage stage;\r
-       Actor firstWidget;\r
-       Actor secondWidget;\r
-       Rectangle firstWidgetBounds = new Rectangle();\r
-       Rectangle secondWidgetBounds = new Rectangle();\r
-       Rectangle handleBounds = new Rectangle();\r
-       Rectangle[] scissors = new Rectangle[] {new Rectangle(), new Rectangle()};\r
-       boolean touchDrag = false;\r
+       protected SplitPaneStyle style;\r
+\r
+       protected boolean invalidated = false;\r
+\r
+       protected boolean vertical;\r
+       protected float splitAmount = 0.5f;\r
+       protected float minAmount = 0;\r
+       protected float maxAmount = 1;\r
+       protected float oldSplitAmount = 0;\r
+       protected Stage stage;\r
+       protected Actor firstWidget;\r
+       protected Actor secondWidget;\r
+       protected Rectangle firstWidgetBounds = new Rectangle();\r
+       protected Rectangle secondWidgetBounds = new Rectangle();\r
+       protected Rectangle handleBounds = new Rectangle();\r
+       protected Rectangle[] scissors = new Rectangle[] {new Rectangle(), new Rectangle()};\r
+       protected boolean touchDrag = false;\r
 \r
        public SplitPane (Actor firstWidget, Actor secondWidget, boolean vertical, Stage stage, Skin skin) {\r
                this(firstWidget, secondWidget, vertical, stage, skin.getStyle(SplitPaneStyle.class), null);\r
index 7ac10aa..713fcd0 100644 (file)
@@ -93,31 +93,31 @@ import com.badlogic.gdx.utils.FloatArray;
  * \r
  * @author mzechner */\r
 public class TextField extends Widget {\r
-       TextFieldStyle style;\r
-\r
-       Clipboard clipboard;\r
-       final Rectangle fieldBounds = new Rectangle();\r
-       final TextBounds textBounds = new TextBounds();\r
-       final Rectangle scissor = new Rectangle();\r
-\r
-       TextFieldListener listener;\r
-       String text = "";\r
-       int cursor = 0;\r
-       float renderOffset = 0;\r
-       float textOffset = 0;\r
-       int visibleTextStart = 0;\r
-       int visibleTextEnd = 0;\r
-       final StringBuilder builder = new StringBuilder();\r
-       final FloatArray glyphAdvances = new FloatArray();\r
-       final FloatArray glyphPositions = new FloatArray();\r
-       float blinkTime = 0.42f;\r
-       long lastBlink = System.nanoTime();\r
-       boolean cursorOn = true;\r
-       boolean hasSelection = false;\r
-       int selectionStart = 0;\r
-       float selectionX = 0;\r
-       float selectionWidth = 0;\r
-       OnscreenKeyboard keyboard = new DefaultOnscreenKeyboard();\r
+       protected TextFieldStyle style;\r
+\r
+       protected Clipboard clipboard;\r
+       protected final Rectangle fieldBounds = new Rectangle();\r
+       protected final TextBounds textBounds = new TextBounds();\r
+       protected final Rectangle scissor = new Rectangle();\r
+\r
+       protected TextFieldListener listener;\r
+       protected String text = "";\r
+       protected int cursor = 0;\r
+       protected float renderOffset = 0;\r
+       protected float textOffset = 0;\r
+       protected int visibleTextStart = 0;\r
+       protected int visibleTextEnd = 0;\r
+       protected final StringBuilder builder = new StringBuilder();\r
+       protected final FloatArray glyphAdvances = new FloatArray();\r
+       protected final FloatArray glyphPositions = new FloatArray();\r
+       protected float blinkTime = 0.42f;\r
+       protected long lastBlink = System.nanoTime();\r
+       protected boolean cursorOn = true;\r
+       protected boolean hasSelection = false;\r
+       protected int selectionStart = 0;\r
+       protected float selectionX = 0;\r
+       protected float selectionWidth = 0;\r
+       protected OnscreenKeyboard keyboard = new DefaultOnscreenKeyboard();\r
 \r
        public TextField (Skin skin) {\r
                this("", skin.getStyle(TextFieldStyle.class), null);\r
index 5f93119..58f53a0 100644 (file)
@@ -74,17 +74,17 @@ import com.badlogic.gdx.scenes.scene2d.ui.utils.ScissorStack;
  * \r
  * @author mzechner */\r
 public class Window extends Table {\r
-       WindowStyle style;\r
-       String title;\r
-       final Stage stage;\r
-       final Rectangle widgetBounds = new Rectangle();\r
-       final Rectangle titleBounds = new Rectangle();\r
-       final TextBounds textBounds = new TextBounds();\r
-       final Rectangle scissors = new Rectangle();\r
-       boolean move = false;\r
-       boolean isMovable = true;\r
-       final Vector2 initial = new Vector2();\r
-       boolean isModal = false;\r
+       protected WindowStyle style;\r
+       protected String title;\r
+       protected final Stage stage;\r
+       protected final Rectangle widgetBounds = new Rectangle();\r
+       protected final Rectangle titleBounds = new Rectangle();\r
+       protected final TextBounds textBounds = new TextBounds();\r
+       protected final Rectangle scissors = new Rectangle();\r
+       protected boolean move = false;\r
+       protected boolean isMovable = true;\r
+       protected final Vector2 initial = new Vector2();\r
+       protected boolean isModal = false;\r
 \r
        public Window (String title, Stage stage, Skin skin) {\r
                this(null, title, stage, skin.getStyle(WindowStyle.class), 0, 0);\r