public void setThreeD(final Node threeDNode) {
   if (threeDNode != null) {
     String boolStr = threeDNode.getText();
     Boolean booleanValue = new Boolean(boolStr);
     setThreeD(booleanValue.booleanValue());
   }
 }
 public void setLegendIncluded(final Node legendNode) {
   if (legendNode != null) {
     String boolStr = legendNode.getText();
     Boolean booleanValue = new Boolean(boolStr);
     setLegendIncluded(booleanValue.booleanValue());
   }
 }
  public static void initParams(String[] s) {
    if (s.length != 3) {
      autorun = true;
      debug = false;
      testModifier = NONE;
    } else {
      autorun = Boolean.valueOf(s[0]);
      debug = Boolean.valueOf(s[1]);

      if (s[2].equals("NONE")) {
        testModifier = NONE;
      }
      if (s[2].equals("SHIFT")) {
        testModifier = SHIFT;
      }
      if (s[2].equals("CTRL")) {
        testModifier = CTRL;
      }
      if (s[2].equals("ALT")) {
        testModifier = ALT;
      }
    }
    System.out.println("Autorun : " + autorun);
    System.out.println("Debug mode : " + debug);
    System.out.println("Modifier to verify : " + testModifier);
  }
예제 #4
0
    @Override
    public Component getTableCellRendererComponent(
        JTable table, Object value, boolean isSelected, boolean isFocused, int row, int col) {

      if (isSelected) {
        setBackground(table.getSelectionBackground());
        setForeground(table.getSelectionForeground());
      } else {
        setForeground(table.getForeground());
        if (row % 2 == 0) {
          setBackground(EVEN_COLOR);
        } else {
          setBackground(ODD_COLOR);
        }
      }

      if (value != null && value instanceof Boolean) {

        Boolean imported = (Boolean) value;

        if (imported.booleanValue()) {
          this.setIcon(FLAG_ICON);
        } else {
          this.setIcon(null);
        }
        this.setText("");

      } else {
        setIcon(null);
        this.setText(value == null ? "" : value.toString());
      }
      return this;
    }
 public void setDomainVerticalTickLabels(final Node domainVerticalTickLabelsNode) {
   if (domainVerticalTickLabelsNode != null) {
     String boolStr = domainVerticalTickLabelsNode.getText();
     Boolean booleanValue = new Boolean(boolStr);
     setDomainVerticalTickLabels(booleanValue.booleanValue());
   }
 }
예제 #6
0
  public static void main(String[] s) {
    System.out.println("STAGE 1");
    System.setProperty("sun.awt.enableExtraMouseButtons", "true");
    boolean propValue = Boolean.parseBoolean(System.getProperty("sun.awt.enableExtraMouseButtons"));
    if (!propValue) {
      throw new RuntimeException(
          "TEST FAILED(1) : System property sun.awt.enableExtraMouseButtons = " + propValue);
    }
    if (!Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled()) {
      throw new RuntimeException(
          "TEST FAILED(1) : Toolkit.areExtraMouseButtonsEnabled() returns false");
    }

    System.out.println("STAGE 2");
    System.setProperty("sun.awt.enableExtraMouseButtons", "false");
    propValue = Boolean.parseBoolean(System.getProperty("sun.awt.enableExtraMouseButtons"));
    if (propValue) {
      throw new RuntimeException(
          "TEST FAILED(2) : System property sun.awt.enableExtraMouseButtons = " + propValue);
    }
    if (!Toolkit.getDefaultToolkit().areExtraMouseButtonsEnabled()) {
      throw new RuntimeException(
          "TEST FAILED(2) : Toolkit.areExtraMouseButtonsEnabled() returns false");
    }
    System.out.println("Test passed.");
  }
 /** @param markersVisibleNode set the markers visibility from an XML node */
 public void setMarkersVisible(final Node markersVisibleNode) {
   if (markersVisibleNode != null) {
     String boolStr = markersVisibleNode.getText();
     Boolean booleanValue = new Boolean(boolStr);
     setMarkersVisible(booleanValue.booleanValue());
   }
 }
 public void setStacked(final Node stackedNode) {
   if (stackedNode != null) {
     String boolStr = stackedNode.getText();
     Boolean booleanValue = new Boolean(boolStr);
     setStacked(booleanValue.booleanValue());
   }
 }
 private boolean hasFinalModifier() {
   final Boolean createFinals =
       JavaRefactoringSettings.getInstance().INTRODUCE_PARAMETER_CREATE_FINALS;
   return createFinals == null
       ? CodeStyleSettingsManager.getSettings(myProject).GENERATE_FINAL_PARAMETERS
       : createFinals.booleanValue();
 }
예제 #10
0
 /** Load the preferences and make them available to the Application object. */
 private void applyPreferences() {
   Preferences preferences = Preferences.userNodeForPackage(Application.class);
   ENABLE_DEVICE_SUPPORT =
       Boolean.valueOf(preferences.get(Application.PREFERENCE_ENABLE_DEVICE_SUPPORT, "false"));
   ENABLE_NETWORK_SUPPORT =
       Boolean.valueOf(preferences.get(Application.PREFERENCE_ENABLE_NETWORK_SUPPORT, "false"));
 }
  public boolean dirty() {
    if (!XJApplication.shared().supportsPersistence()) return false;

    Boolean b = (Boolean) jFrame.getRootPane().getClientProperty(PROPERTY_WINDOW_MODIFIED);
    if (b == null) return false;
    else return b.booleanValue();
  }
예제 #12
0
 public void addServerTypeToSnooper(PlayerUsageSnooper playerSnooper) {
   playerSnooper.addStatToSnooper("singleplayer", Boolean.valueOf(this.isSinglePlayer()));
   playerSnooper.addStatToSnooper("server_brand", this.getServerModName());
   playerSnooper.addStatToSnooper(
       "gui_supported", GraphicsEnvironment.isHeadless() ? "headless" : "supported");
   playerSnooper.addStatToSnooper("dedicated", Boolean.valueOf(this.isDedicatedServer()));
 }
 public void setBorderVisible(final Node borderVisibleNode) {
   if (borderVisibleNode != null) {
     String boolStr = borderVisibleNode.getText();
     Boolean booleanValue = new Boolean(boolStr);
     setBorderVisible(booleanValue.booleanValue());
   }
 }
예제 #14
0
 /**
  * Gets the <code>defaultLightWeightPopupEnabled</code> property, which by default is <code>true
  * </code>.
  *
  * @return the value of the <code>defaultLightWeightPopupEnabled</code> property
  * @see #setDefaultLightWeightPopupEnabled
  */
 public static boolean getDefaultLightWeightPopupEnabled() {
   Boolean b = (Boolean) SwingUtilities.appContextGet(defaultLWPopupEnabledKey);
   if (b == null) {
     SwingUtilities.appContextPut(defaultLWPopupEnabledKey, Boolean.TRUE);
     return true;
   }
   return b.booleanValue();
 }
예제 #15
0
 void LoadConfig() {
   String id = Long.toString(robot_uid);
   limit_top = Double.valueOf(prefs.get(id + "_limit_top", "0"));
   limit_bottom = Double.valueOf(prefs.get(id + "_limit_bottom", "0"));
   limit_left = Double.valueOf(prefs.get(id + "_limit_left", "0"));
   limit_right = Double.valueOf(prefs.get(id + "_limit_right", "0"));
   m1invert = Boolean.parseBoolean(prefs.get(id + "_m1invert", "false"));
   m2invert = Boolean.parseBoolean(prefs.get(id + "_m2invert", "false"));
 }
 private void setMarked(int rowIndex, final boolean marked) {
   final T element = myElements.get(rowIndex);
   final Boolean newValue = marked ? Boolean.TRUE : Boolean.FALSE;
   final Boolean prevValue = myMarkedMap.put(element, newValue);
   fireTableRowsUpdated(rowIndex, rowIndex);
   if (!newValue.equals(prevValue)) {
     notifyElementMarked(element, marked);
   }
 }
예제 #17
0
 void SaveConfig() {
   String id = Long.toString(robot_uid);
   prefs.put(id + "_limit_top", Double.toString(limit_top));
   prefs.put(id + "_limit_bottom", Double.toString(limit_bottom));
   prefs.put(id + "_limit_right", Double.toString(limit_right));
   prefs.put(id + "_limit_left", Double.toString(limit_left));
   prefs.put(id + "_m1invert", Boolean.toString(m1invert));
   prefs.put(id + "_m2invert", Boolean.toString(m2invert));
 }
예제 #18
0
  /** Synchronizes the state of the actions to the current state of this host. */
  private void updateActions() {
    final DeviceController currentDeviceController = getDeviceController();

    final boolean deviceControllerSet = currentDeviceController != null;
    final boolean deviceCapturing = deviceControllerSet && currentDeviceController.isCapturing();
    final boolean deviceSetup =
        deviceControllerSet && !deviceCapturing && currentDeviceController.isSetup();

    getAction(CaptureAction.ID).setEnabled(deviceControllerSet);
    getAction(CancelCaptureAction.ID).setEnabled(deviceCapturing);
    getAction(RepeatCaptureAction.ID).setEnabled(deviceSetup);

    final boolean projectChanged = this.projectManager.getCurrentProject().isChanged();
    final boolean projectSavedBefore =
        this.projectManager.getCurrentProject().getFilename() != null;
    final boolean dataAvailable = this.dataContainer.hasCapturedData();

    getAction(SaveProjectAction.ID).setEnabled(projectChanged);
    getAction(SaveProjectAsAction.ID).setEnabled(projectSavedBefore && projectChanged);
    getAction(SaveDataFileAction.ID).setEnabled(dataAvailable);

    getAction(ZoomInAction.ID).setEnabled(dataAvailable);
    getAction(ZoomOutAction.ID).setEnabled(dataAvailable);
    getAction(ZoomDefaultAction.ID).setEnabled(dataAvailable);
    getAction(ZoomFitAction.ID).setEnabled(dataAvailable);

    final boolean triggerEnable = dataAvailable && this.dataContainer.hasTriggerData();
    getAction(GotoTriggerAction.ID).setEnabled(triggerEnable);

    // Update the cursor actions accordingly...
    final boolean enableCursors = dataAvailable && this.dataContainer.isCursorsEnabled();

    for (int c = 0; c < CapturedData.MAX_CURSORS; c++) {
      final boolean enabled = enableCursors && this.dataContainer.isCursorPositionSet(c);
      getAction(GotoNthCursorAction.getID(c)).setEnabled(enabled);
    }

    getAction(GotoFirstCursorAction.ID).setEnabled(enableCursors);
    getAction(GotoLastCursorAction.ID).setEnabled(enableCursors);

    getAction(SetCursorModeAction.ID).setEnabled(dataAvailable);
    getAction(SetCursorModeAction.ID)
        .putValue(Action.SELECTED_KEY, Boolean.valueOf(this.dataContainer.isCursorsEnabled()));

    boolean anyCursorSet = false;
    for (int c = 0; c < CapturedData.MAX_CURSORS; c++) {
      final boolean cursorPositionSet = this.dataContainer.isCursorPositionSet(c);
      anyCursorSet |= cursorPositionSet;

      final Action action = getAction(SetCursorAction.getCursorId(c));
      action.setEnabled(dataAvailable);
      action.putValue(Action.SELECTED_KEY, Boolean.valueOf(cursorPositionSet));
    }

    getAction(ClearCursors.ID).setEnabled(enableCursors && anyCursorSet);
  }
  private void setActive(boolean active) {
    myCloseButton.putClientProperty("paintActive", Boolean.valueOf(active));

    if (getWindowDecorationStyle() == JRootPane.FRAME) {
      myIconifyButton.putClientProperty("paintActive", Boolean.valueOf(active));
      myToggleButton.putClientProperty("paintActive", Boolean.valueOf(active));
    }

    getRootPane().repaint();
  }
예제 #20
0
 public void propertyChange(PropertyChangeEvent e) {
   String propertyName = e.getPropertyName();
   if (e.getPropertyName().equals(Action.NAME)) {
     String text = (String) e.getNewValue();
     menuItem.setText(text);
   } else if (propertyName.equals("enabled")) {
     Boolean enabledState = (Boolean) e.getNewValue();
     menuItem.setEnabled(enabledState.booleanValue());
   }
 }
  @Override
  @SuppressWarnings({"EmptyCatchBlock"})
  public void readExternal(final Element element) {
    myId = element.getAttributeValue(ID_ATTR);
    myWasRead = true;
    try {
      myActive = Boolean.valueOf(element.getAttributeValue(ACTIVE_ATTR)).booleanValue();
    } catch (NumberFormatException ignored) {
    }
    try {
      myAnchor = ToolWindowAnchor.fromText(element.getAttributeValue(ANCHOR_ATTR));
    } catch (IllegalArgumentException ignored) {
    }
    myAutoHide = Boolean.valueOf(element.getAttributeValue(AUTOHIDE_ATTR)).booleanValue();
    try {
      myInternalType = ToolWindowType.valueOf(element.getAttributeValue(INTERNAL_TYPE_ATTR));
    } catch (IllegalArgumentException ignored) {
    }
    try {
      setTypeAndCheck(ToolWindowType.valueOf(element.getAttributeValue(TYPE_ATTR)));
    } catch (IllegalArgumentException ignored) {
    }
    myVisible = Boolean.valueOf(element.getAttributeValue(VISIBLE_ATTR)).booleanValue();
    if (element.getAttributeValue(SHOW_STRIPE_BUTTON) != null) {
      myShowStripeButton =
          Boolean.valueOf(element.getAttributeValue(SHOW_STRIPE_BUTTON)).booleanValue();
    }
    try {
      myWeight = Float.parseFloat(element.getAttributeValue(WEIGHT_ATTR));
    } catch (NumberFormatException ignored) {
    }
    try {
      String value = element.getAttributeValue(SIDE_WEIGHT_ATTR);
      if (value != null) {
        mySideWeight = Float.parseFloat(value);
      }
    } catch (NumberFormatException ignored) {
    }
    try {
      myOrder = Integer.valueOf(element.getAttributeValue(ORDER_ATTR)).intValue();
    } catch (NumberFormatException ignored) {
    }
    try {
      int x = Integer.parseInt(element.getAttributeValue(X_ATTR));
      int y = Integer.parseInt(element.getAttributeValue(Y_ATTR));
      int width = Integer.parseInt(element.getAttributeValue(WIDTH_ATTR));
      int height = Integer.parseInt(element.getAttributeValue(HEIGHT_ATTR));
      myFloatingBounds = new Rectangle(x, y, width, height);
    } catch (NumberFormatException ignored) {
    }
    mySplitMode = Boolean.parseBoolean(element.getAttributeValue(SIDE_TOOL_ATTR));

    myContentUiType =
        ToolWindowContentUiType.getInstance(element.getAttributeValue(CONTENT_UI_ATTR));
  }
예제 #22
0
 public void propertyChange(PropertyChangeEvent e) {
   String propertyName = e.getPropertyName();
   if (e.getPropertyName().equals(Action.NAME)) {
     String text = (String) e.getNewValue();
     menuItem.setText(text);
   } else if (propertyName.equals("enabled")) {
     // System.out.println("Debug:TextViewer: ActionChangedListener enabled");
     Boolean enabledState = (Boolean) e.getNewValue();
     menuItem.setEnabled(enabledState.booleanValue());
   }
 }
예제 #23
0
 public void keyPressed(KeyEvent e) {
   int code = e.getKeyCode();
   if (code == KeyEvent.VK_SPACE) {
     AbstractButton button = (AbstractButton) e.getSource();
     Boolean wasPressed = (Boolean) button.getClientProperty(SPACEBAR_PRESSED);
     if (wasPressed == null || wasPressed.booleanValue() == false) {
       button.putClientProperty(SPACEBAR_PRESSED, Boolean.TRUE);
       button.doClick();
     }
   }
 }
예제 #24
0
 public static boolean isScratchImageValid(Image img) {
   try {
     Boolean lost = (Boolean) tryMethod(img, "contentsLost", new Object[] {});
     if (lost == null) return true; // method does not exist->not volatile
     // System.out.println("volatile");
     return !lost.booleanValue();
   } catch (java.security.AccessControlException e) {
     // we're not allowed to do this (we're probably an applet)
     // we assume we created a nonvolatile image
     return true;
   }
 }
 @NotNull
 private Element writeComposite(
     VirtualFile file,
     EditorWithProviderComposite composite,
     boolean pinned,
     EditorWithProviderComposite selectedEditor) {
   Element fileElement = new Element("file");
   fileElement.setAttribute("leaf-file-name", file.getName()); // TODO: all files
   composite.currentStateAsHistoryEntry().writeExternal(fileElement, getManager().getProject());
   fileElement.setAttribute(PINNED, Boolean.toString(pinned));
   fileElement.setAttribute(CURRENT_IN_TAB, Boolean.toString(composite.equals(selectedEditor)));
   return fileElement;
 }
예제 #26
0
  private static boolean wasEverInitialized(@NotNull Project project) {
    Boolean was = project.getUserData(PROJECT_WAS_EVER_INITIALIZED);
    if (was == null) {
      if (project.isInitialized()) {
        was = Boolean.valueOf(true);
        project.putUserData(PROJECT_WAS_EVER_INITIALIZED, was);
      } else {
        was = Boolean.valueOf(false);
      }
    }

    return was.booleanValue();
  }
예제 #27
0
  private Element generatePortNode(Document doc, Port port) {
    Element portEl = doc.createElement(EL_PORT);

    portEl.setAttribute(ATR_NAME, port.getName());
    portEl.setAttribute(ATR_TYPE, port.getType());
    portEl.setAttribute(ATR_X, Integer.toString(port.getX()));
    portEl.setAttribute(ATR_Y, Integer.toString(port.getY()));
    portEl.setAttribute(ATR_PORT_CONNECTION, port.isArea() ? "area" : "");
    portEl.setAttribute(ATR_STRICT, Boolean.toString(port.isStrict()));
    portEl.setAttribute(ATR_MULTI, Boolean.toString(port.isMulti()));

    return portEl;
  }
예제 #28
0
 public static boolean isWindowActive(Window window) {
   if (getJavaVersion() >= 1.4) {
     try {
       Class paramTypes[] = null;
       Object args[] = null;
       Method m = window.getClass().getMethod("isActive", paramTypes);
       Boolean b = (Boolean) m.invoke(window, args);
       return b.booleanValue();
     } catch (Exception ex) {
     }
   }
   return true;
 }
  public void configurationChanged(ConfigurationChangeEvent evt) {
    if (evt == null || evt.getPropertyName().startsWith("recording")) {
      enableMouseMoves = cfg.getBoolean("recording.enableMouseMoves").booleanValue();
      enableMouseDrags = cfg.getBoolean("recording.enableMouseDrags").booleanValue();
      enableMouseClicks = cfg.getBoolean("recording.enableMouseClicks").booleanValue();
      enableKeyboard = cfg.getBoolean("recording.enableKeyboard").booleanValue();
      enableMouseWheel = cfg.getBoolean("recording.enableMouseWheel").booleanValue();

      RFB_SIZE_LIMIT = cfg.getInteger("recording.minEventSize").intValue();

      // This delay will be used to decide whether two subsequent clicks define a double click or
      // two separate clicks
      mouseMultiDelay = cfg.getInteger("recording.mouse.multiClickDelay").intValue();
      mouseMoveDelay = cfg.getInteger("recording.mouse.moveDelay").intValue();
      mouseMoveInsertPrevious = cfg.getInteger("recording.mouse.moveInsertPrevious").intValue();
      if (mouseMovesList.size() > mouseMoveInsertPrevious) {
        mouseMovesList.remove(mouseMovesList.size() - 1);
      }

      keyMutiDelay = cfg.getInteger("recording.keyboard.multiKeyDelay").intValue();
      useTypeline = cfg.getBoolean("recording.keyboard.enableTypeline").booleanValue();
      typelineDelay = cfg.getInteger("recording.keyboard.typelineDelay").intValue();

      insertUpdateArea = cfg.getBoolean("recording.waitfor.update.insertArea").booleanValue();
      insertUpdateExtent = cfg.getBoolean("recording.waitfor.update.insertExtent").booleanValue();
      defaultUpdateExtent = cfg.getDouble("recording.waitfor.update.defaultExtent").floatValue();
      insertUpdateTimeout = cfg.getBoolean("recording.waitfor.update.insertTimeout").booleanValue();
      timeoutUpdateRatio = cfg.getDouble("recording.waitfor.update.timeoutRatio").floatValue();
      useMinUpdateTimeout = cfg.getBoolean("recording.waitfor.update.useMinTimeout").booleanValue();
      minUpdateTimeout = cfg.getInteger("recording.waitfor.update.minTimeout").intValue();

      useUpdateWait = cfg.getBoolean("recording.waitfor.update.useWait").booleanValue();
      useMinUpdateWait = cfg.getBoolean("recording.waitfor.update.useMinWait").booleanValue();
      waitUpdateRatio = cfg.getDouble("recording.waitfor.update.waitRatio").floatValue();
      minUpdateWait = cfg.getInteger("recording.waitfor.update.minWait").intValue();
      resetUpdateWait = cfg.getBoolean("recording.waitfor.update.resetUpdateWait").booleanValue();

      useBellCount = cfg.getBoolean("recording.waitfor.bell.useCount").booleanValue();
      insertBellTimeout = cfg.getBoolean("recording.waitfor.bell.insertTimeout").booleanValue();
      timeoutBellRatio = cfg.getDouble("recording.waitfor.bell.timeoutRatio").floatValue();
      useMinBellTimeout = cfg.getBoolean("recording.waitfor.bell.useMinTimeout").booleanValue();
      minBellTimeout = cfg.getInteger("recording.waitfor.bell.minTimeout").intValue();
      resetBellWait = cfg.getBoolean("recording.waitfor.bell.resetBellWait").booleanValue();
    } else if (evt.getPropertyName().startsWith("rfb.readOnly")) {
      Boolean b = cfg.getBoolean("rfb.readOnly");
      readOnly = b == null ? false : b.booleanValue();
      if (readOnly) {
        resetTime();
      }
    }
  }
예제 #30
0
  public boolean requestWindowFocus(long time, boolean timeProvided) {
    focusLog.fine("Request for decorated window focus");
    // If this is Frame or Dialog we can't assure focus request success - but we still can try
    // If this is Window and its owner Frame is active we can be sure request succedded.
    Window win = (Window) target;
    Window focusedWindow = XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow();
    Window activeWindow = XWindowPeer.getDecoratedOwner(focusedWindow);

    focusLog.log(
        Level.FINER,
        "Current window is: active={0}, focused={1}",
        new Object[] {Boolean.valueOf(win == activeWindow), Boolean.valueOf(win == focusedWindow)});

    XWindowPeer toFocus = this;
    while (toFocus.nextTransientFor != null) {
      toFocus = toFocus.nextTransientFor;
    }

    if (this == toFocus) {
      if (focusAllowedFor()) {
        if (win == activeWindow && win != focusedWindow) {
          // Happens when focus is on window child
          focusLog.fine("Focus is on child window - transfering it back");
          handleWindowFocusInSync(-1);
        } else {
          focusLog.fine("Requesting focus to this window");
          if (timeProvided) {
            requestXFocus(time);
          } else {
            requestXFocus();
          }
        }
        return true;
      } else {
        return false;
      }
    } else if (toFocus.focusAllowedFor()) {
      focusLog.fine("Requesting focus to " + toFocus);
      if (timeProvided) {
        toFocus.requestXFocus(time);
      } else {
        toFocus.requestXFocus();
      }
      return false;
    } else {
      // This might change when WM will have property to determine focus policy.
      // Right now, because policy is unknown we can't be sure we succedded
      return false;
    }
  }