?? scaleeditor.java
字號:
/* * This source code is part of TWaver 1.3.1 * * SERVA Software PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * Copyright 2000-2005 SERVA Software, Inc. All rights reserved. */package demo.sheet.customsheet;
import java.awt.Window;
import java.awt.event.ActionEvent;
import javax.swing.JOptionPane;
import javax.swing.JSlider;
import javax.swing.SwingUtilities;
import twaver.table.editor.ActionTableCellEditor;
public class ScaleEditor extends ActionTableCellEditor{
private JSlider slider = new JSlider(JSlider.HORIZONTAL, 0, 100, 50);
public ScaleEditor(){
super(new ScaleRenderer());
}
public void actionPerformed(ActionEvent e) {
Object value = this.getValue();
if(value instanceof Number){
int intValue = (int)(((Number)value).doubleValue() * 100);
slider.setValue(intValue);
}
Window window = (Window)SwingUtilities.getAncestorOfClass(Window.class, getActionButton());
int result = JOptionPane.showOptionDialog(window
, slider, (String)getTable().getColumnName(getColumn())
, JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, null, null, null);
if(result==JOptionPane.OK_OPTION) {
this.setValue(new Float(slider.getValue()/100.0));
this.fireEditingStopped();
}else{
this.fireEditingCanceled();
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -