Exemple #1
0
 public AddressBar(SceneDocument document) {
   this.document = document;
   document.getRenderer().addExceptionListener(this);
   addMouseListener(this);
   setMinimumSize(new Dimension(0, ADDRESS_BAR_HEIGHT));
   setMaximumSize(new Dimension(Integer.MAX_VALUE, ADDRESS_BAR_HEIGHT));
   setPreferredSize(new Dimension(Integer.MAX_VALUE, ADDRESS_BAR_HEIGHT));
   setLayout(null);
 }
Exemple #2
0
 public void mouseReleased(MouseEvent e) {
   armed = -1;
   int mx = e.getX();
   int partIndex = partIndex(mx);
   if (partIndex == -1) return;
   java.util.List<Network> networks = getNetworkParts();
   Network selectedNetwork = networks.get(partIndex);
   if (selectedNetwork != null) document.setCurrentNetwork(selectedNetwork);
   repaint();
 }
Exemple #3
0
 private Network getCurrentNetwork() {
   return document.getCurrentNetwork();
 }