Ejemplo n.º 1
0
 @Override
 public void nativeMousePressed(NativeMouseEvent e) {
   Platform.runLater(
       () -> {
         events.getChildren().add(new EventLabel("Pressed: " + e.getButton()));
         eventsScrollPane.setVvalue(1.0);
       });
 }
Ejemplo n.º 2
0
 @Override
 public void nativeMouseWheelMoved(NativeMouseWheelEvent e) {
   // say("Scrolled: " + e.getWheelRotation());
   Platform.runLater(
       () -> {
         events.getChildren().add(new EventLabel("Scrolled: " + e.getWheelRotation()));
         eventsScrollPane.setVvalue(1.0);
       });
 }
Ejemplo n.º 3
0
 @Override
 public void nativeMouseReleased(NativeMouseEvent e) {
   // say("released: " + e.getPoint());
   Platform.runLater(
       () -> {
         events.getChildren().add(new EventLabel("Released: " + e.getButton()));
         eventsScrollPane.setVvalue(1.0);
       });
 }
Ejemplo n.º 4
0
 private CharacterGridButton createGridButton(
     CharacterButtonDto dto, Selector<CharacterIdentifier> characterSelector) {
   CharacterGridButton characterGridButton = new CharacterGridButton();
   characterGridButton.initContent(dto, characterSelector);
   characterGridButton.setToggleGroup(toggleGroup);
   buttonsByIdentifier.put(dto.identifier, characterGridButton);
   gridPane.getChildren().add(0, characterGridButton.getNode());
   scrollPane.setVvalue(0);
   return characterGridButton;
 }
Ejemplo n.º 5
0
 /**
  * Create a scroll pane of one of the databases
  *
  * @param type A string of either SQLInterface.TABITEM or SQLInterface.TABPERSON used to determine
  *     which database to print.
  * @return A scroll pane showing the database chosen in the parameter or the person database by
  *     default.
  * @throws IOException
  */
 public static ScrollPane printDatabase(String type) throws IOException {
   TextArea textArea;
   switch (type) {
     case (SQLInterface.TABITEM):
       textArea = new TextArea(itemDatabase.getDatabase().toString());
       break;
     case (SQLInterface.TABPERSON):
       textArea = new TextArea(personDatabase.getDatabase().toString());
       break;
     default:
       textArea = new TextArea(personDatabase.getDatabase().toString());
       break;
   }
   textArea.setEditable(false); // stop the user being able to edit this and thinking it will save.
   ScrollPane scrollPane = new ScrollPane(textArea);
   textArea.setWrapText(true);
   scrollPane.setHvalue(600);
   scrollPane.setVvalue(800);
   return scrollPane;
 }