modify the license.

This commit is contained in:
huanghongxun
2015-06-22 17:25:47 +08:00
parent 0656227183
commit c760461f91
192 changed files with 2863 additions and 1389 deletions

View File

@@ -1,7 +1,18 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
* Copyright 2013 huangyuhui <huanghongxun2008@126.com>
*
* 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 2 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.
*/
package org.jackhuang.hellominecraft.views;
@@ -16,72 +27,63 @@ import java.awt.image.Raster;
import java.awt.image.WritableRaster;
public abstract class AbstractFilter
implements BufferedImageOp
{
public abstract BufferedImage filter(BufferedImage paramBufferedImage1, BufferedImage paramBufferedImage2);
implements BufferedImageOp {
public Rectangle2D getBounds2D(BufferedImage src)
{
return new Rectangle(0, 0, src.getWidth(), src.getHeight());
}
@Override
public abstract BufferedImage filter(BufferedImage paramBufferedImage1, BufferedImage paramBufferedImage2);
public BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel destCM)
{
if (destCM == null) {
destCM = src.getColorModel();
@Override
public Rectangle2D getBounds2D(BufferedImage src) {
return new Rectangle(0, 0, src.getWidth(), src.getHeight());
}
return new BufferedImage(destCM, destCM.createCompatibleWritableRaster(src.getWidth(), src.getHeight()), destCM.isAlphaPremultiplied(), null);
}
@Override
public BufferedImage createCompatibleDestImage(BufferedImage src, ColorModel destCM) {
if (destCM == null)
destCM = src.getColorModel();
public Point2D getPoint2D(Point2D srcPt, Point2D dstPt)
{
return (Point2D)srcPt.clone();
}
public RenderingHints getRenderingHints()
{
return null;
}
protected int[] getPixels(BufferedImage img, int x, int y, int w, int h, int[] pixels)
{
if ((w == 0) || (h == 0)) {
return new int[0];
return new BufferedImage(destCM, destCM.createCompatibleWritableRaster(src.getWidth(), src.getHeight()), destCM.isAlphaPremultiplied(), null);
}
if (pixels == null)
pixels = new int[w * h];
else if (pixels.length < w * h) {
throw new IllegalArgumentException("pixels array must have a length >= w*h");
@Override
public Point2D getPoint2D(Point2D srcPt, Point2D dstPt) {
return (Point2D) srcPt.clone();
}
int imageType = img.getType();
if ((imageType == 2) || (imageType == 1))
{
Raster raster = img.getRaster();
return (int[])(int[])raster.getDataElements(x, y, w, h, pixels);
@Override
public RenderingHints getRenderingHints() {
return null;
}
return img.getRGB(x, y, w, h, pixels, 0, w);
}
protected int[] getPixels(BufferedImage img, int x, int y, int w, int h, int[] pixels) {
if ((w == 0) || (h == 0))
return new int[0];
protected void setPixels(BufferedImage img, int x, int y, int w, int h, int[] pixels)
{
if ((pixels == null) || (w == 0) || (h == 0))
return;
if (pixels.length < w * h) {
throw new IllegalArgumentException("pixels array must have a length >= w*h");
if (pixels == null)
pixels = new int[w * h];
else if (pixels.length < w * h)
throw new IllegalArgumentException("pixels array must have a length >= w*h");
int imageType = img.getType();
if ((imageType == 2) || (imageType == 1)) {
Raster raster = img.getRaster();
return (int[]) (int[]) raster.getDataElements(x, y, w, h, pixels);
}
return img.getRGB(x, y, w, h, pixels, 0, w);
}
int imageType = img.getType();
if ((imageType == 2) || (imageType == 1))
{
WritableRaster raster = img.getRaster();
raster.setDataElements(x, y, w, h, pixels);
protected void setPixels(BufferedImage img, int x, int y, int w, int h, int[] pixels) {
if ((pixels == null) || (w == 0) || (h == 0))
return;
if (pixels.length < w * h)
throw new IllegalArgumentException("pixels array must have a length >= w*h");
int imageType = img.getType();
if ((imageType == 2) || (imageType == 1)) {
WritableRaster raster = img.getRaster();
raster.setDataElements(x, y, w, h, pixels);
} else
img.setRGB(x, y, w, h, pixels, 0, w);
}
else {
img.setRGB(x, y, w, h, pixels, 0, w);
}
}
}

View File

@@ -1,7 +1,18 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
* Copyright 2013 huangyuhui <huanghongxun2008@126.com>
*
* 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 2 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.
*/
package org.jackhuang.hellominecraft.views;

View File

@@ -1,7 +1,18 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
* Copyright 2013 huangyuhui <huanghongxun2008@126.com>
*
* 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 2 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.
*/
package org.jackhuang.hellominecraft.views;
@@ -39,6 +50,7 @@ public class DropShadowBorder extends AbstractBorder {
color = c;
}
@Override
public Insets getBorderInsets(Component c) {
return this.insets;
}
@@ -48,6 +60,7 @@ public class DropShadowBorder extends AbstractBorder {
return getBorderInsets(c);
}
@Override
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
BufferedImage shadow = new BufferedImage(width, height, 2);

View File

@@ -1,7 +1,18 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
* Copyright 2013 huangyuhui <huanghongxun2008@126.com>
*
* 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 2 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.
*/
package org.jackhuang.hellominecraft.views;
@@ -27,6 +38,7 @@ public class FastBlurFilter extends AbstractFilter {
return this.radius;
}
@Override
public BufferedImage filter(BufferedImage src, BufferedImage dst) {
int width = src.getWidth();
int height = src.getHeight();

View File

@@ -1,6 +1,18 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* Copyright 2013 huangyuhui <huanghongxun2008@126.com>
*
* 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 2 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.
*/
package org.jackhuang.hellominecraft.views;
@@ -10,7 +22,6 @@ import org.jackhuang.hellominecraft.utils.functions.DoneListener0Return;
import org.jackhuang.hellominecraft.utils.DoubleOutputStream;
import org.jackhuang.hellominecraft.utils.LauncherPrintStream;
import org.jackhuang.hellominecraft.utils.StrUtils;
import org.jackhuang.hellominecraft.utils.SwingUtils;
import org.jackhuang.hellominecraft.utils.TextComponentOutputStream;
import org.jackhuang.hellominecraft.utils.Utils;

View File

@@ -1,11 +1,21 @@
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
* Copyright 2013 huangyuhui <huanghongxun2008@126.com>
*
* 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 2 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.
*/
package org.jackhuang.hellominecraft.views;
import org.jackhuang.hellominecraft.utils.SwingUtils;
/**
* The frame given to choose things.
* @author hyh

View File

@@ -1,7 +1,18 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
* Copyright 2013 huangyuhui <huanghongxun2008@126.com>
*
* 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 2 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.
*/
package org.jackhuang.hellominecraft.views;
@@ -54,19 +65,9 @@ public class TintablePanel extends JPanel {
if (this.overIcon != null) {
this.overIcon.setVisible(tintActive);
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
TintablePanel.this.revalidate();
}
});
EventQueue.invokeLater(TintablePanel.this::revalidate);
}
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
TintablePanel.this.repaint();
}
});
EventQueue.invokeLater(TintablePanel.this::repaint);
}
@Override