AMADEUS html plain
import javax.swing.*;
* import java.awt.
class Item38Listener
class Item38Listener implements ActionListener
Edit + Toggle text color
AmFrame frame;
Item38Listener(AmFrame fr)
konstruktor
public void actionPerformed(ActionEvent event)
AmCanvas c = frame.viewArea;
int kind = c.selection.kind();
??kind
? Selection.PRIMITIVE:
frame.contents.editor.toggleColorInPrimitive(c.selection);
<======
? Selection.PRIMITIVETEXT:
tekst vo~i teksti osa*
Text t = c.selection.start.primitive.text;
Row r1 = c.selection.start.row;
Row r2 = c.selection.end.row;
? c.selection.start == c.selection.end
kogu tekst (yhe klo~psuga)
frame.contents.editor.toggleColorInText(c.selection, t,
r1, c.selection.start.noInRow, r2, c.selection.end.noInRow - 1);
<======
teksti osa
? r1 == r2
yhes reas
frame.contents.editor.toggleColorInRow(c.selection, r1,
c.selection.start.noInRow, c.selection.end.noInRow - 1);
<======
frame.contents.editor.toggleColorInText(
c.selection, t,
r1, c.selection.start.noInRow,
r2, c.selection.end.noInRow - 1);
<======
? Selection.PRIMITIVECOMMENT:
? Selection.SCHEMECOMMENT2SCHEMECOMMENT:
kogu kommentaar vo~i osa kommentaarist
Row r = c.selection.start.row;
? c.selection.start == c.selection.end
valitud on (klo~psuga) kogu kommentaar
frame.contents.editor.toggleColorInRow(c.selection, r,
0, r.elements.size()-1);
<======
valitud on (vedamisega) osa kommentaarist
frame.contents.editor.toggleColorInRow(c.selection, r,
c.selection.start.noInRow, c.selection.end.noInRow - 1);
c.own = true; c.repaint();