}
}
});
this.addMouseMotionListener(new MouseMotionAdapter() {
@Override
public void mouseDragged(final MouseEvent event) {
int x = event.getX();
int y = event.getY();
int un = Vis.this.getSize().height - 50;
int re = Vis.this.getSize().width - 50;
int li = 50;
if (Vis.this.gewKnot != null) {
if (x < li) {
x = li;
}
if (x > re) {
x = re;
}
if (y < ConstantsDarstellung.OBEN) {
y = ConstantsDarstellung.OBEN;
}
if (y > un) {
y = un;
}
Vis.this.darstArten[Vis.this.aktAut].neueKoord(
Vis.this.gewKnot, x, y);
Vis.this.aktGraph = Vis.this.darstArten[Vis.this.aktAut]
.erzeuge(Vis.this.rob.vAuts()[Vis.this.aktAut],
Vis.this.selKnot[Vis.this.aktAut]);
Vis.super.update(Vis.this.getGraphics());
Vis.this.repaint();
}
}
});
return;
}
this.addKeyListener(new KeyListener() {
/**
* Die Key-Typed-Methode.
*/
@Override
public void keyTyped(final KeyEvent e) {
}
/**
* Die Key-Released-Methode.
*/
@Override
public void keyReleased(final KeyEvent e) {
}
/**
* Die Key-Pressed-Methode.
*/
@Override
public void keyPressed(final KeyEvent e) {
if (e.getKeyCode() == java.awt.event.KeyEvent.VK_C) {
if (e.isControlDown()) {
String copy = Vis.this.holeAktGrSeq();
StaticMethods.log(StaticMethods.LOG_DEBUG,
"In Zwischenablage (" + copy + ")",
Vis.this.pars);
Vis.this.zwischenablage.copyToClipboard(copy);
}
}
if (e.getKeyCode() == java.awt.event.KeyEvent.VK_V) {
if (e.isControlDown()) {
String copy = Vis.this.zwischenablage.getClipbB();
StaticMethods.log(
StaticMethods.LOG_DEBUG,
"Aus Zwischenablage mit Standardtranslator ("
+ copy
+ ")",
Vis.this.pars);
// try {
// Vis.this.erzeugeAktAusSequenz(
// SonstMeth.decompressString(
// copy,
// Vis.this.pars),
// null,
// false);
// } catch (Exception e1) {
Vis.this.erzeugeAktAusSequenz(copy, null, false);
// }
Vis.this.steuer.loescheSelKnot();
Vis.this.repaint();
}
}
}
});
this.addMouseListener(new MouseAdapter() {
@Override
public void mousePressed(final MouseEvent event) {
if (!Vis.this.simLaueft) {
final int x = event.getX();
final int y = event.getY();
final int radius = (int) (
eas.startSetup.marbBuilder.zeichenModi.ConstantsZeichenModi.KN_DURCHM) / 2;
ArrayList<Knoten> naKn;
naKn = Vis.this.aktGraph.holeUmObj(x, y, radius);
if (naKn.size() > 0) {
Vis.this.gewKnot = naKn.get(0);
Vis.this.selKnot[Vis.this.aktAut] = naKn
.get(0);
} else {
Vis.this.selKnot[Vis.this.aktAut] = null;
}
Vis.this.neuZeichnen();
}
}
@Override
public void mouseClicked(final MouseEvent event) {
if (!Vis.this.simLaueft) {
if (event.getButton() == 1 && event.getClickCount() == 2) {
final int x = event.getX();
final int y = event.getY();
final int radius = (int) (
eas.startSetup.marbBuilder.zeichenModi.ConstantsZeichenModi.KN_DURCHM)
/ 2;
ArrayList<Knoten> naKn;
naKn = Vis.this.aktGraph.holeUmObj(x, y, radius);
if (naKn.size() > 0) {
Vis.this.rob.vAuts()[Vis.this.aktAut]
.setStart(naKn.get(0));
} else {
Vis.this.rob.vAuts()[Vis.this.aktAut]
.entferneStartZ();
}
Vis.this.neuZeichnen();
Vis.this.steuer
.selKn(Vis.this.selKnot[Vis.this.aktAut]);
} else if (event.getButton() == 3
&& event.getClickCount() == 2) {
final int x = event.getX();
final int y = event.getY();
final int radius = (int) (
eas.startSetup.marbBuilder.zeichenModi.ConstantsZeichenModi.KN_DURCHM)
/ 2;
ArrayList<Knoten> naKn;
naKn = Vis.this.aktGraph.holeUmObj(x, y, radius);
if (naKn.size() > 0) {
Vis.this.rob.vAuts()[Vis.this.aktAut]
.einfStern(naKn.get(0)
.holeName(),
new ArrayList<Integer>(Vis.this.rob
.vAuts()[Vis.this.aktAut]
.holAdj().keySet()));
Vis.this.neuZeichnen();
Vis.this.steuer
.selKn(Vis.this.selKnot[Vis.this.aktAut]);
}
} else if (event.getButton() == 3
&& event.getClickCount() == 3) {
final int x = event.getX();
final int y = event.getY();
final int radius = (int) (
eas.startSetup.marbBuilder.zeichenModi.ConstantsZeichenModi.KN_DURCHM)
/ 2;
ArrayList<Knoten> naKn;
naKn = Vis.this.aktGraph.holeUmObj(x, y, radius);
if (naKn.size() == 0) {
Vis.this.rob.vAuts()[Vis.this.aktAut]
.einfClique(new ArrayList<Integer>(
Vis.this.rob.vAuts()[Vis.this.aktAut]
.holAdj().keySet()));
Vis.this.neuZeichnen();
Vis.this.steuer
.selKn(Vis.this.selKnot[Vis.this.aktAut]);
}
}
}
}
@Override
public void mouseReleased(final MouseEvent event) {
if (!Vis.this.simLaueft) {
Vis.this.gewKnot = null;
Vis.this.steuer.selKn(Vis.this.selKnot[Vis.this.aktAut]);
}
}
});
this.addMouseMotionListener(new MouseMotionAdapter() {
@Override
public void mouseDragged(final MouseEvent event) {
int x = event.getX();
int y = event.getY();