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); }
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(); }
private Network getCurrentNetwork() { return document.getCurrentNetwork(); }