Advertisement
Olivki

Swagger

Mar 30th, 2013
318
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.99 KB | None | 0 0
  1. package se.proxus.frames;
  2.  
  3. public interface Component {
  4.  
  5.     /**
  6.      * The method for drawing the components UI.
  7.      *
  8.      * @param x
  9.      *            The X coordinate of the mouse.
  10.      * @param y
  11.      *            The Y coordinate of the mouse.
  12.      * @param ticks
  13.      *            The amount of ticks and shit. (Don't actually know what they
  14.      *            fucking use this for.)
  15.      */
  16.     public void draw(int x, int y, float ticks);
  17.  
  18.     /**
  19.      * The method for running things if the component has been pressed.
  20.      *
  21.      * @param x
  22.      *            The X coordinate of the mouse.
  23.      * @param y
  24.      *            The Y coordinate of the mouse.
  25.      * @param type
  26.      *            What part of the mouse that got clicked. <i>(0 = Left Click, 1
  27.      *            = Right Click, 2 = Middle Mouse Click)</i>
  28.      */
  29.     public void mouseClicked(int x, int y, int type);
  30.  
  31.     /**
  32.      * Sets the components text.
  33.      *
  34.      * @param text
  35.      *            The desired text.
  36.      */
  37.     public void setText(String text);
  38.  
  39.     /**
  40.      * Gets the components text.
  41.      *
  42.      * @return The components text.
  43.      */
  44.     public String getText();
  45.  
  46.     /**
  47.      * Sets the components x coordinate.
  48.      *
  49.      * @param x
  50.      *            The desired x coordinate.
  51.      */
  52.     public void setX(int x);
  53.  
  54.     /**
  55.      * Gets the components x coordinate.
  56.      *
  57.      * @return The components x coordinate.
  58.      */
  59.     public int getX();
  60.  
  61.     /**
  62.      * Sets the components y coordinate.
  63.      *
  64.      * @param y
  65.      *            The desired y coordinate.
  66.      */
  67.     public void setY(int y);
  68.  
  69.     /**
  70.      * Gets the components y coordinate.
  71.      *
  72.      * @return The components y coordinate.
  73.      */
  74.     public int getY();
  75.  
  76.     /**
  77.      * Sets the components width.
  78.      *
  79.      * @param width
  80.      *            The desired width.
  81.      */
  82.     public void setWidth(int width);
  83.  
  84.     /**
  85.      * Gets the components width.
  86.      *
  87.      * @return The components width.
  88.      */
  89.     public int getWidth();
  90.  
  91.     /**
  92.      * Sets the components height.
  93.      *
  94.      * @param width
  95.      *            The desired height.
  96.      */
  97.     public void setHeight(int height);
  98.  
  99.     /**
  100.      * Gets the components height.
  101.      *
  102.      * @return The components height.
  103.      */
  104.     public int getHeight();
  105.  
  106.     /**
  107.      * Sets the state of the component.
  108.      *
  109.      * @param state
  110.      *            The state of the component.
  111.      */
  112.     public void setState(boolean state);
  113.  
  114.     /**
  115.      * Gets the components current state.
  116.      *
  117.      * @return The components current state.
  118.      */
  119.     public boolean getState();
  120.  
  121.     /**
  122.      * Gets if the mouse is hovering over the component.
  123.      *
  124.      * @param x
  125.      *            The X coordinate of the mouse.
  126.      * @param y
  127.      *            The Y coordinate of the mouse
  128.      * @return If the mouse is hovering over the component.
  129.      */
  130.     public boolean isHovering(int x, int y);
  131.  
  132. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement