📄 ztoolkit.java
字号:
/*
* put your module comment here
* formatted with JxBeauty (c) johann.langhofer@nextra.at
*/
package ezcell;
import java.awt.*;
import java.awt.geom.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.event.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.event.*;
import java.awt.dnd.*;
import java.awt.datatransfer.*;
import javax.swing.undo.*;
/**
* put your documentation comment here
*/
public class ZToolkit {
static int i = 0;
static public void out(String text)
{
System.out.println((++i)+text);
}
/**
* put your documentation comment here
* @param child
*/
public static void moveCenter(Component child) {
Component parent = child.getParent();
child.setLocation(parent.getX() + ((parent.getWidth() - child.getWidth()) / 2),
parent.getY() + ((parent.getHeight() - child.getHeight()) / 2));
}
/**
* put your documentation comment here
* @param parent
* @param child
*/
public static void moveCenter(Component parent, Component child) {
child.setLocation(parent.getX() + ((parent.getWidth() - child.getWidth()) / 2),
parent.getY() + ((parent.getHeight() - child.getHeight()) / 2));
}
}
/**
* put your documentation comment here
*/
class _RowComparator
implements Comparator {
/**
* put your documentation comment here
* @param a
* @param b
* @return
*/
public int compare (Object a, Object b) {
ZShape.Row r;
;
Point p;
if (a instanceof Point) {
p = (Point)a;
r = (ZShape.Row)b;
if (p.y >= r.top && p.y <= r.bottom)
return 0;
else if (p.y > r.bottom)
return 1;
else
return -1;
}
else {
p = (Point)b;
r = (ZShape.Row)a;
if (p.y >= r.top && p.y <= r.bottom)
return 0;
else if (p.y > r.bottom)
return -1;
else
return 1;
}
}
}
/**
* put your documentation comment here
*/
class _ColComparator
implements Comparator {
/**
* put your documentation comment here
* @param a
* @param b
* @return
*/
public int compare (Object a, Object b) {
ZShape.Col c;
Point p;
if (a instanceof Point) {
p = (Point)a;
c = (ZShape.Col)b;
if (p.x >= c.left && p.x <= c.right)
return 0;
else if (p.x > c.right)
return 1;
else
return -1;
}
else {
p = (Point)b;
c = (ZShape.Col)a;
if (p.x >= c.left && p.x <= c.right)
return 0;
else if (p.x > c.right)
return -1;
else
return 1;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -