// the MouseListener events public void mousePressed(MouseEvent evt) { Dimension dim = getSize(); String layerName = (String) dialog.threeDLayerList.getSelectedValue(); Layer selectedLayer = dialog.curTech.findLayer(layerName); GenMath.MutableDouble height = dialog.threeDDistanceMap.get(selectedLayer); int yValue = dim.height - (int) ((height.doubleValue() - lowHeight) / (highHeight - lowHeight) * dim.height + 0.5); if (Math.abs(yValue - evt.getY()) > 5) { int bestDist = dim.height; for (Iterator<Layer> it = dialog.curTech.getLayers(); it.hasNext(); ) { Layer layer = it.next(); if (layer.isPseudoLayer()) continue; height = dialog.threeDDistanceMap.get(layer); yValue = dim.height - (int) ((height.doubleValue() - lowHeight) / (highHeight - lowHeight) * dim.height + 0.5); int dist = Math.abs(yValue - evt.getY()); if (dist < bestDist) { bestDist = dist; selectedLayer = layer; } } dialog.threeDLayerList.setSelectedValue(selectedLayer.getName(), true); dialog.threeDValuesChanged(false); } }
public void removeUpdate(DocumentEvent e) { dialog.threeDValuesChanged(true); }
public void insertUpdate(DocumentEvent e) { dialog.threeDValuesChanged(true); }