Codota Logo
Led.getWidth
Code IndexAdd Codota to your IDE (free)

How to use
getWidth
method
in
eu.hansolo.steelseries.extras.Led

Best Java code snippets using eu.hansolo.steelseries.extras.Led.getWidth (Showing top 14 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Charset c =
  • Codota IconString charsetName;Charset.forName(charsetName)
  • Codota IconCharset.defaultCharset()
  • Codota IconContentType contentType;contentType.getCharset()
  • Smart code suggestions by Codota
}
origin: org.bidib.jbidib.eu.hansolo/SteelSeries

/**
 * Sets the state of the led
 * @param LED_ON
 */
public void setLedOn(final boolean LED_ON) {
  if (ledOn == LED_ON) {return;}
  ledOn = LED_ON;
  init(getWidth());
  repaint();
}
origin: org.bidib.jbidib.eu.hansolo/SteelSeries

/**
 * Sets the type of LED.
 * @param LED_TYPE Possible values are ROUND, RECT_VERTICAL and RECT_HORIZONTAL
 */
public void setLedType(final LedType LED_TYPE) {
  if (ledType == LED_TYPE) {return;}
  ledType = LED_TYPE;
  final boolean LED_WAS_ON = currentLedImage.equals(ledImageOn) ? true : false;
  flushImages();
  ledImageOff = create_LED_Image(getWidth(), 0, ledColor, ledType);
  ledImageOn = create_LED_Image(getWidth(), 1, ledColor, ledType);
  currentLedImage = LED_WAS_ON == true ? ledImageOn : ledImageOff;
  repaint();
}
origin: HanSolo/SteelSeries-Swing

/**
 * Sets the state of the led
 * @param LED_ON
 */
public void setLedOn(final boolean LED_ON) {
  if (ledOn == LED_ON) {return;}
  ledOn = LED_ON;
  init(getWidth());
  repaint();
}
origin: HanSolo/SteelSeries-Swing

/**
 * Sets the type of LED.
 * @param LED_TYPE Possible values are ROUND, RECT_VERTICAL and RECT_HORIZONTAL
 */
public void setLedType(final LedType LED_TYPE) {
  if (ledType == LED_TYPE) {return;}
  ledType = LED_TYPE;
  final boolean LED_WAS_ON = currentLedImage.equals(ledImageOn) ? true : false;
  flushImages();
  ledImageOff = create_LED_Image(getWidth(), 0, ledColor, ledType);
  ledImageOn = create_LED_Image(getWidth(), 1, ledColor, ledType);
  currentLedImage = LED_WAS_ON == true ? ledImageOn : ledImageOff;
  repaint();
}
origin: org.bidib.jbidib.eu.hansolo/SteelSeries

/**
 * Returns the current component as buffered image.
 * To save this buffered image as png you could use for example:
 * File file = new File("image.png");
 * ImageIO.write(Image, "png", file);
 * @return the current component as buffered image
 */
public BufferedImage getAsImage() {
  final BufferedImage IMAGE = UTIL.createImage(getWidth(), getHeight(), Transparency.TRANSLUCENT);
  final Graphics2D G2 = IMAGE.createGraphics();
  paintAll(G2);
  G2.dispose();
  return IMAGE;
}
// </editor-fold>
origin: HanSolo/SteelSeries-Swing

/**
 * Sets the color that will be used to calculate the custom led color
 * @param COLOR
 */
public void setCustomLedColor(final Color COLOR) {
  if (customLedColor.COLOR.equals(COLOR)) {return;}
  customLedColor = new CustomLedColor(COLOR);
  final boolean LED_WAS_ON = currentLedImage.equals(ledImageOn) ? true : false;
  flushImages();
  ledImageOff = create_LED_Image(getWidth(), 0, ledColor, ledType);
  ledImageOn  = create_LED_Image(getWidth(), 1, ledColor, ledType);
  currentLedImage = LED_WAS_ON == true ? ledImageOn : ledImageOff;
  repaint();
}
origin: org.bidib.jbidib.eu.hansolo/SteelSeries

/**
 * Sets the color that will be used to calculate the custom led color
 * @param COLOR
 */
public void setCustomLedColor(final Color COLOR) {
  if (customLedColor.COLOR.equals(COLOR)) {return;}
  customLedColor = new CustomLedColor(COLOR);
  final boolean LED_WAS_ON = currentLedImage.equals(ledImageOn) ? true : false;
  flushImages();
  ledImageOff = create_LED_Image(getWidth(), 0, ledColor, ledType);
  ledImageOn  = create_LED_Image(getWidth(), 1, ledColor, ledType);
  currentLedImage = LED_WAS_ON == true ? ledImageOn : ledImageOff;
  repaint();
}
origin: HanSolo/SteelSeries-Swing

/**
 * Returns the current component as buffered image.
 * To save this buffered image as png you could use for example:
 * File file = new File("image.png");
 * ImageIO.write(Image, "png", file);
 * @return the current component as buffered image
 */
public BufferedImage getAsImage() {
  final BufferedImage IMAGE = UTIL.createImage(getWidth(), getHeight(), Transparency.TRANSLUCENT);
  final Graphics2D G2 = IMAGE.createGraphics();
  paintAll(G2);
  G2.dispose();
  return IMAGE;
}
// </editor-fold>
origin: org.bidib.jbidib.eu.hansolo/SteelSeries

/**
 * Sets the color of the threshold led.
 * The LedColor is not a standard color but defines a
 * color scheme for the led. The default ledcolor is RED
 * @param LED_COLOR
 */
public void setLedColor(final LedColor LED_COLOR) {
  if (ledColor == LED_COLOR) {return;}
  if (LED_COLOR == null) {
    ledColor = LedColor.RED_LED;
  } else {
    ledColor = LED_COLOR;
  }
  final boolean LED_WAS_ON = currentLedImage.equals(ledImageOn) ? true : false;
  flushImages();
  ledImageOff = create_LED_Image(getWidth(), 0, LED_COLOR, ledType);
  ledImageOn  = create_LED_Image(getWidth(), 1, LED_COLOR, ledType);
  currentLedImage = LED_WAS_ON == true ? ledImageOn : ledImageOff;
  repaint();
}
origin: HanSolo/SteelSeries-Swing

  /**
   * Calculates the rectangle that specifies the area that is available
   * for painting the gauge. This means that if the component has insets
   * that are larger than 0, these will be taken into account.
   */
  private void calcInnerBounds() {
//        final java.awt.Insets INSETS = getInsets();
//        if (getWidth() - INSETS.left - INSETS.right < getHeight() - INSETS.top - INSETS.bottom) {
//            INNER_BOUNDS.setBounds(INSETS.left, INSETS.top, getWidth() - INSETS.left - INSETS.right, getHeight() - INSETS.top - INSETS.bottom);
//        } else {
//            INNER_BOUNDS.setBounds(INSETS.left + (int) (((double) (getWidth() - INSETS.left - INSETS.right) - (double) (getHeight() - INSETS.top - INSETS.bottom)) / 2.0), INSETS.top, getHeight() - INSETS.top - INSETS.bottom, getHeight() - INSETS.top - INSETS.bottom);
//        }

    final Insets INSETS = getInsets();
    final int SIZE = (getWidth() - INSETS.left - INSETS.right) <= (getHeight() - INSETS.top - INSETS.bottom) ? (getWidth() - INSETS.left - INSETS.right) : (getHeight() - INSETS.top - INSETS.bottom);
    //INNER_BOUNDS.setBounds(INSETS.left, INSETS.top, getWidth() - INSETS.left - INSETS.right, getHeight() - INSETS.top - INSETS.bottom);
    INNER_BOUNDS.setBounds(INSETS.left, INSETS.top, SIZE, SIZE);
  }

origin: org.bidib.jbidib.eu.hansolo/SteelSeries

  /**
   * Calculates the rectangle that specifies the area that is available
   * for painting the gauge. This means that if the component has insets
   * that are larger than 0, these will be taken into account.
   */
  private void calcInnerBounds() {
//        final java.awt.Insets INSETS = getInsets();
//        if (getWidth() - INSETS.left - INSETS.right < getHeight() - INSETS.top - INSETS.bottom) {
//            INNER_BOUNDS.setBounds(INSETS.left, INSETS.top, getWidth() - INSETS.left - INSETS.right, getHeight() - INSETS.top - INSETS.bottom);
//        } else {
//            INNER_BOUNDS.setBounds(INSETS.left + (int) (((double) (getWidth() - INSETS.left - INSETS.right) - (double) (getHeight() - INSETS.top - INSETS.bottom)) / 2.0), INSETS.top, getHeight() - INSETS.top - INSETS.bottom, getHeight() - INSETS.top - INSETS.bottom);
//        }

    final Insets INSETS = getInsets();
    final int SIZE = (getWidth() - INSETS.left - INSETS.right) <= (getHeight() - INSETS.top - INSETS.bottom) ? (getWidth() - INSETS.left - INSETS.right) : (getHeight() - INSETS.top - INSETS.bottom);
    //INNER_BOUNDS.setBounds(INSETS.left, INSETS.top, getWidth() - INSETS.left - INSETS.right, getHeight() - INSETS.top - INSETS.bottom);
    INNER_BOUNDS.setBounds(INSETS.left, INSETS.top, SIZE, SIZE);
  }

origin: HanSolo/SteelSeries-Swing

/**
 * Sets the color of the threshold led.
 * The LedColor is not a standard color but defines a
 * color scheme for the led. The default ledcolor is RED
 * @param LED_COLOR
 */
public void setLedColor(final LedColor LED_COLOR) {
  if (ledColor == LED_COLOR) {return;}
  if (LED_COLOR == null) {
    ledColor = LedColor.RED_LED;
  } else {
    ledColor = LED_COLOR;
  }
  final boolean LED_WAS_ON = currentLedImage.equals(ledImageOn) ? true : false;
  flushImages();
  ledImageOff = create_LED_Image(getWidth(), 0, LED_COLOR, ledType);
  ledImageOn  = create_LED_Image(getWidth(), 1, LED_COLOR, ledType);
  currentLedImage = LED_WAS_ON == true ? ledImageOn : ledImageOff;
  repaint();
}
origin: org.bidib.jbidib.eu.hansolo/SteelSeries

  @Override
  public void componentResized(ComponentEvent event) {
    final int SIZE = getWidth() <= getHeight() ? getWidth() : getHeight();
    java.awt.Container parent = getParent();
    if ((parent != null) && (parent.getLayout() == null)) {
      if (SIZE < getMinimumSize().width || SIZE < getMinimumSize().height) {
        setSize(getMinimumSize().width, getMinimumSize().height);
      } else {
        setSize(SIZE, SIZE);
      }
    } else {
      if (SIZE < getMinimumSize().width || SIZE < getMinimumSize().height) {
        setPreferredSize(getMinimumSize());
      } else {
        setPreferredSize(new java.awt.Dimension(SIZE, SIZE));
      }
    }
    calcInnerBounds();
    init(INNER_BOUNDS.width);
    //revalidate();
    //repaint(INNER_BOUNDS);
  }
};
origin: HanSolo/SteelSeries-Swing

  @Override
  public void componentResized(ComponentEvent event) {
    final int SIZE = getWidth() <= getHeight() ? getWidth() : getHeight();
    java.awt.Container parent = getParent();
    if ((parent != null) && (parent.getLayout() == null)) {
      if (SIZE < getMinimumSize().width || SIZE < getMinimumSize().height) {
        setSize(getMinimumSize().width, getMinimumSize().height);
      } else {
        setSize(SIZE, SIZE);
      }
    } else {
      if (SIZE < getMinimumSize().width || SIZE < getMinimumSize().height) {
        setPreferredSize(getMinimumSize());
      } else {
        setPreferredSize(new java.awt.Dimension(SIZE, SIZE));
      }
    }
    calcInnerBounds();
    init(INNER_BOUNDS.width);
    //revalidate();
    //repaint(INNER_BOUNDS);
  }
};
eu.hansolo.steelseries.extrasLedgetWidth

Popular methods of Led

  • addComponentListener
  • calcInnerBounds
    Calculates the rectangle that specifies the area that is available for painting the gauge. This mean
  • create_LED_Image
    Returns a buffered image that represents a led with the given size, state and color
  • flushImages
  • getCurrentLedImage
    Returns the image of the currently used led image.
  • getHeight
  • getInsets
  • getLedImageOff
    Returns the image of the switched off threshold led with the currently active ledcolor.
  • getLedImageOn
    Returns the image of the switched on threshold led with the currently active ledcolor.
  • getMinimumSize
  • getParent
  • init
  • getParent,
  • init,
  • invalidate,
  • paintAll,
  • repaint,
  • setCurrentLedImage,
  • setPreferredSize,
  • setSize,
  • <init>

Popular in Java

  • Creating JSON documents from java classes using gson
  • startActivity (Activity)
  • runOnUiThread (Activity)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
  • JList (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now