-
Notifications
You must be signed in to change notification settings - Fork 0
UIImageButton.java
Raphael Lutz edited this page Jul 12, 2018
·
2 revisions
It is the same object as UITextButton
but with image displayed instead of text. It can contains two pairs of images if the button should change when clicked (as the famous play/pause button, switch between play and pause).
-
BufferedImage imgIdle1, imgActive1, imgIdle2, imgActive2
: the pairs (not hovered, hovered) of images, if two pairs, then display switch between 1 and 2 when clicked -
ClickListener clicker
: a link to the currentClickListener
-
boolean isActivable = true
: tells if the button is activable, id est clickable -
boolean isVisible = true
: tells if the button is displayed (useful for sub-buttons) -
boolean oneMode = true
: tells if the button as only one mode, or two -
boolean isMode1 = true
: tells the current mode, 1 or 2
-
UIImageButton(float x, float y, int width, int height, BufferedImage imgIdle, BufferedImage imgActive, ClickListener clicker)
: constructor for only one pair of images (no second mode) -
UIImageButton(float x, float y, int width, int height, BufferedImage imgIdle1, BufferedImage imgActive1, BufferedImage imgIdle2, BufferedImage imgActive2, ClickListener clicker)
: constructor for two pairs of images (mode 1 or 2) -
void tick()
: the tick method, being called at each step of time -
void render(Graphics g)
: the render method, renders the button and its image -
void onClick()
: called when button is clicked -
void switchMode()
: switch between mode 1 and 2 -
void setVisible(boolean isVisible)
: setter forisVisible
-
void switchActivable()
:switch the
isActivable` value -
void setActivable(boolean isActivable)
: setter forisActivable
- data/
- DataManager.java (TODO)
- ExpVarCalculator.java (TODO)
- VehicleCounter.java (TODO)
- elements/
- Cell.java (TODO)
- Connection.java (TODO)
- CrossRoad.java (empty) (TODO)
- Direction.java (TODO)
- MaxVehicleOutflow.java (TODO)
- MultiLaneRoundAbout.java (TODO)
- Phase.java (TODO)
- Ride.java (TODO)
- Road.java (empty) (TODO)
- RoundAbout.java (empty) (TODO)
- TrafficLightsSystem.java (TODO)
- Vehicle.java (TODO)
- graphics/
- Assets.java (TODO)
- Display.java (TODO)
- ImageLoader.java (TODO)
- SpriteSheet.java (TODO)
- Text.java (TODO)
- input/
- KeyManager.java (TODO)
- MouseManager.java (TODO)
- main/
- Main.java (TODO)
- Simulation.java (TODO)
- network/
- AllNetworkRides.java (empty) (TODO)
- Network.java (TODO)
- NetworkComputing.java (TODO)
- NetworkRendering.java (TODO)
- states/
- MenuState.java (TODO)
- SimSettingsState.java (TODO)
- SimState.java (TODO)
- State.java (TODO)
- ui/
- ClickListener.java (TODO)
- UIImageButton.java (TODO)
- UIManager.java (TODO)
- UIObject.java (TODO)
- UISlider.java (TODO)
- UISliderDouble.java (TODO)
- UISliderTriple.java (TODO)
- UITextButton.java (TODO)
- UITextSwitch.java (TODO)
- utils/
- Defaults.java (TODO)
- OriginDestinationCalculator.java (TODO)
- SortByPos.java (TODO)
- Utils.java (TODO)