Package ketUI

Source Code of ketUI.UpperCaseGreekMenuFrame

/*
* Copyright (C) 2011  Alasdair C. Hamilton
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>
*/

package ketUI;

import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import javax.swing.border.*;


import geom.Position;
import ket.MathCollection;
import ket.Selection;
import ket.display.ImageTools;
import ket.math.Argument;
import ket.math.Branch;
import ket.math.Equation;
import ket.math.Function;
import ket.math.Symbol;
import ket.math.SymbolicFunction;
import ket.math.Token;
import ket.math.purpose.Word;
import ketUI.chord.Chord;
import ketUI.chord.KeyboardEventHandler;
import ketUI.modes.AddMode;
import ketUI.modes.DocumentState;
import ketUI.modes.NormalMode;
import ketUI.responder.MouseResponder;

class UpperCaseGreekMenuFrame extends ButtonMenu {
  public UpperCaseGreekMenuFrame(Document document, JButton source) {
    super(document);
    setupUserInterface(source, 4, 6, 200, 200, "Insert an upper case Greek letter");
    setHold(true);
  }

  @Override
  public void buttonSetup() {
    for (Symbol symbol : Symbol.UPPER_CASE_GREEK_LETTERS) {
      JButton button = new JButton(symbol.toUnicode());
      button.setFocusable(false);
      button.addActionListener(this);
      button.setToolTipText(symbol.getFullName());
      add(button);
    }
  }

  @Override
  public void replaceByText(String text) {
    for (Symbol symbol : Symbol.UPPER_CASE_GREEK_LETTERS) {
      if (symbol.toUnicode().equals(text)) {
        getSelection().replace(new Token(symbol));
      }
    }
  }
}
TOP

Related Classes of ketUI.UpperCaseGreekMenuFrame

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.