⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ztoolkit.java

📁 用Java写的报表.功能如下: 0.内建网络打印,网络预览功能! 1.文件操作。包括url 指定的文件。 2.全功能打印支持。包括打印预览。 3.Undo 和 redo。 4.合并单元格。 5.Cel
💻 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 + -