Ejemplo n.º 1
0
  @Override
  public void renderLabel(Graphics gfx, Label label) {
    int x = label.getAbsoluteX();
    int y = label.getAbsoluteY();

    if (label.getImage() != null) gfx.drawImage(label.getImage(), x, y);

    if (label.getText() != null) {
      gfx.setColor(label.getTextColor());
      label.getText().render(gfx, x, y);
    }
  }
 private Label createNoExistingAssigneeLabel() {
   Label noExistingAssignee = new Label(MESSAGE_NO_ASSIGNEE);
   noExistingAssignee.setPrefHeight(40);
   FontLoader fontLoader = Toolkit.getToolkit().getFontLoader();
   double width =
       fontLoader.computeStringWidth(noExistingAssignee.getText(), noExistingAssignee.getFont());
   noExistingAssignee.setPrefWidth(width);
   return noExistingAssignee;
 }
Ejemplo n.º 3
0
 public String getInfo() {
   return "type:\tControllerGroup"
       + "\nname:\t"
       + _myName
       + "\n"
       + "label:\t"
       + _myLabel.getText()
       + "\n"
       + "id:\t"
       + _myId
       + "\n"
       + "value:\t"
       + _myValue
       + "\n"
       + "arrayvalue:\t"
       + ControlP5IOHandler.arrayToString(_myArrayValue)
       + "\n"
       + "position:\t"
       + position
       + "\n"
       + "absolute:\t"
       + absolutePosition
       + "\n"
       + "width:\t"
       + getWidth()
       + "\n"
       + "height:\t"
       + getHeight()
       + "\n"
       + "color:\t"
       + getColor()
       + "\n"
       + "visible:\t"
       + isVisible
       + "\n"
       + "moveable:\t"
       + isMoveable
       + "\n";
 }
Ejemplo n.º 4
0
  /**
   * Updates {@link Label}s in the label database and refreshes the label cache.
   *
   * <p>NOTE: This method relies on the id field of the {@link Label}s being populated, so callers
   * must obtain fully populated objects from {@link #getLabelForViewIdFromCache(String)} or {@link
   * #getLabelForLabelIdFromDatabase(Long, DirectLabelFetchRequest.OnLabelFetchedListener)} in order
   * to update them.
   *
   * @param labels The {@link Label}s to remove
   */
  public void updateLabel(Label... labels) {
    if (!isInitialized()) {
      return;
    }

    if (labels == null || labels.length == 0) {
      LogUtils.log(this, Log.WARN, "Attempted to update a null or empty array of labels.");
      return;
    }

    for (Label l : labels) {
      if (l == null) {
        throw new IllegalArgumentException("Attempted to update a null label.");
      }

      if (TextUtils.isEmpty(l.getText())) {
        throw new IllegalArgumentException("Attempted to update a label with an empty text value");
      }

      final LabelUpdateRequest request = new LabelUpdateRequest(l, null);
      final LabelUpdateTask task = new LabelUpdateTask();
      task.execute(request);
    }
  }
 public String getMessage() {
   return messageLabel == null ? null : messageLabel.getText();
 }
 public String getTitle() {
   return titleLabel == null ? null : titleLabel.getText();
 }
Ejemplo n.º 7
0
 public CharSequence getText() {
   return label.getText();
 }
 public String getTitoloTxt() {
   return labelTitolo.getText();
 }