first commit
This commit is contained in:
commit
cf97b64877
27585 changed files with 3281780 additions and 0 deletions
13
rus/WEB-INF/lib/jxl_src/jxl/common/Assert.java
Normal file
13
rus/WEB-INF/lib/jxl_src/jxl/common/Assert.java
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
package jxl.common;
|
||||
|
||||
public final class Assert {
|
||||
public static void verify(boolean condition) {
|
||||
if (!condition)
|
||||
throw new AssertionFailed();
|
||||
}
|
||||
|
||||
public static void verify(boolean condition, String message) {
|
||||
if (!condition)
|
||||
throw new AssertionFailed(message);
|
||||
}
|
||||
}
|
||||
11
rus/WEB-INF/lib/jxl_src/jxl/common/AssertionFailed.java
Normal file
11
rus/WEB-INF/lib/jxl_src/jxl/common/AssertionFailed.java
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
package jxl.common;
|
||||
|
||||
public class AssertionFailed extends RuntimeException {
|
||||
public AssertionFailed() {
|
||||
printStackTrace();
|
||||
}
|
||||
|
||||
public AssertionFailed(String s) {
|
||||
super(s);
|
||||
}
|
||||
}
|
||||
13
rus/WEB-INF/lib/jxl_src/jxl/common/BaseUnit.java
Normal file
13
rus/WEB-INF/lib/jxl_src/jxl/common/BaseUnit.java
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
package jxl.common;
|
||||
|
||||
public class BaseUnit {
|
||||
private int index;
|
||||
|
||||
protected BaseUnit(int ind) {
|
||||
this.index = ind;
|
||||
}
|
||||
|
||||
protected int getIndex() {
|
||||
return this.index;
|
||||
}
|
||||
}
|
||||
28
rus/WEB-INF/lib/jxl_src/jxl/common/LengthConverter.java
Normal file
28
rus/WEB-INF/lib/jxl_src/jxl/common/LengthConverter.java
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
package jxl.common;
|
||||
|
||||
public class LengthConverter {
|
||||
private static double[][] factors = new double[LengthUnit.getCount()][LengthUnit.getCount()];
|
||||
|
||||
static {
|
||||
factors[LengthUnit.POINTS.getIndex()][LengthUnit.POINTS.getIndex()] = 1.0D;
|
||||
factors[LengthUnit.METRES.getIndex()][LengthUnit.METRES.getIndex()] = 1.0D;
|
||||
factors[LengthUnit.CENTIMETRES.getIndex()][LengthUnit.CENTIMETRES.getIndex()] = 1.0D;
|
||||
factors[LengthUnit.INCHES.getIndex()][LengthUnit.INCHES.getIndex()] = 1.0D;
|
||||
factors[LengthUnit.POINTS.getIndex()][LengthUnit.METRES.getIndex()] = 3.5277777778E-4D;
|
||||
factors[LengthUnit.POINTS.getIndex()][LengthUnit.CENTIMETRES.getIndex()] = 0.035277777778D;
|
||||
factors[LengthUnit.POINTS.getIndex()][LengthUnit.INCHES.getIndex()] = 0.013888888889D;
|
||||
factors[LengthUnit.METRES.getIndex()][LengthUnit.POINTS.getIndex()] = 2877.84D;
|
||||
factors[LengthUnit.METRES.getIndex()][LengthUnit.CENTIMETRES.getIndex()] = 100.0D;
|
||||
factors[LengthUnit.METRES.getIndex()][LengthUnit.INCHES.getIndex()] = 39.37D;
|
||||
factors[LengthUnit.CENTIMETRES.getIndex()][LengthUnit.POINTS.getIndex()] = 28.34643D;
|
||||
factors[LengthUnit.CENTIMETRES.getIndex()][LengthUnit.METRES.getIndex()] = 0.01D;
|
||||
factors[LengthUnit.CENTIMETRES.getIndex()][LengthUnit.INCHES.getIndex()] = 0.3937D;
|
||||
factors[LengthUnit.INCHES.getIndex()][LengthUnit.POINTS.getIndex()] = 72.0D;
|
||||
factors[LengthUnit.INCHES.getIndex()][LengthUnit.METRES.getIndex()] = 0.0254D;
|
||||
factors[LengthUnit.INCHES.getIndex()][LengthUnit.CENTIMETRES.getIndex()] = 2.54D;
|
||||
}
|
||||
|
||||
public static double getConversionFactor(LengthUnit from, LengthUnit to) {
|
||||
return factors[from.getIndex()][to.getIndex()];
|
||||
}
|
||||
}
|
||||
21
rus/WEB-INF/lib/jxl_src/jxl/common/LengthUnit.java
Normal file
21
rus/WEB-INF/lib/jxl_src/jxl/common/LengthUnit.java
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package jxl.common;
|
||||
|
||||
public class LengthUnit extends BaseUnit {
|
||||
private static int count = 0;
|
||||
|
||||
private LengthUnit() {
|
||||
super(count++);
|
||||
}
|
||||
|
||||
public static int getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public static LengthUnit POINTS = new LengthUnit();
|
||||
|
||||
public static LengthUnit METRES = new LengthUnit();
|
||||
|
||||
public static LengthUnit CENTIMETRES = new LengthUnit();
|
||||
|
||||
public static LengthUnit INCHES = new LengthUnit();
|
||||
}
|
||||
63
rus/WEB-INF/lib/jxl_src/jxl/common/Logger.java
Normal file
63
rus/WEB-INF/lib/jxl_src/jxl/common/Logger.java
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
package jxl.common;
|
||||
|
||||
import java.security.AccessControlException;
|
||||
import jxl.common.log.LoggerName;
|
||||
import jxl.common.log.SimpleLogger;
|
||||
|
||||
public abstract class Logger {
|
||||
private static Logger logger = null;
|
||||
|
||||
public static final Logger getLogger(Class cl) {
|
||||
if (logger == null)
|
||||
initializeLogger();
|
||||
return logger.getLoggerImpl(cl);
|
||||
}
|
||||
|
||||
private static synchronized void initializeLogger() {
|
||||
if (logger != null)
|
||||
return;
|
||||
String loggerName = LoggerName.NAME;
|
||||
try {
|
||||
loggerName = System.getProperty("logger");
|
||||
if (loggerName == null)
|
||||
loggerName = LoggerName.NAME;
|
||||
logger = (Logger)Class.forName(loggerName).newInstance();
|
||||
} catch (IllegalAccessException e) {
|
||||
logger = new SimpleLogger();
|
||||
logger.warn("Could not instantiate logger " + loggerName + " using default");
|
||||
} catch (InstantiationException e) {
|
||||
logger = new SimpleLogger();
|
||||
logger.warn("Could not instantiate logger " + loggerName + " using default");
|
||||
} catch (AccessControlException e) {
|
||||
logger = new SimpleLogger();
|
||||
logger.warn("Could not instantiate logger " + loggerName + " using default");
|
||||
} catch (ClassNotFoundException e) {
|
||||
logger = new SimpleLogger();
|
||||
logger.warn("Could not instantiate logger " + loggerName + " using default");
|
||||
}
|
||||
}
|
||||
|
||||
public abstract void debug(Object paramObject);
|
||||
|
||||
public abstract void debug(Object paramObject, Throwable paramThrowable);
|
||||
|
||||
public abstract void error(Object paramObject);
|
||||
|
||||
public abstract void error(Object paramObject, Throwable paramThrowable);
|
||||
|
||||
public abstract void fatal(Object paramObject);
|
||||
|
||||
public abstract void fatal(Object paramObject, Throwable paramThrowable);
|
||||
|
||||
public abstract void info(Object paramObject);
|
||||
|
||||
public abstract void info(Object paramObject, Throwable paramThrowable);
|
||||
|
||||
public abstract void warn(Object paramObject);
|
||||
|
||||
public abstract void warn(Object paramObject, Throwable paramThrowable);
|
||||
|
||||
protected abstract Logger getLoggerImpl(Class paramClass);
|
||||
|
||||
public void setSuppressWarnings(boolean w) {}
|
||||
}
|
||||
5
rus/WEB-INF/lib/jxl_src/jxl/common/log/LoggerName.java
Normal file
5
rus/WEB-INF/lib/jxl_src/jxl/common/log/LoggerName.java
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
package jxl.common.log;
|
||||
|
||||
public class LoggerName {
|
||||
public static final String NAME = SimpleLogger.class.getName();
|
||||
}
|
||||
79
rus/WEB-INF/lib/jxl_src/jxl/common/log/SimpleLogger.java
Normal file
79
rus/WEB-INF/lib/jxl_src/jxl/common/log/SimpleLogger.java
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
package jxl.common.log;
|
||||
|
||||
import jxl.common.Logger;
|
||||
|
||||
public class SimpleLogger extends Logger {
|
||||
private boolean suppressWarnings = false;
|
||||
|
||||
public void debug(Object message) {
|
||||
if (!this.suppressWarnings) {
|
||||
System.out.print("Debug: ");
|
||||
System.out.println(message);
|
||||
}
|
||||
}
|
||||
|
||||
public void debug(Object message, Throwable t) {
|
||||
if (!this.suppressWarnings) {
|
||||
System.out.print("Debug: ");
|
||||
System.out.println(message);
|
||||
t.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void error(Object message) {
|
||||
System.err.print("Error: ");
|
||||
System.err.println(message);
|
||||
}
|
||||
|
||||
public void error(Object message, Throwable t) {
|
||||
System.err.print("Error: ");
|
||||
System.err.println(message);
|
||||
t.printStackTrace();
|
||||
}
|
||||
|
||||
public void fatal(Object message) {
|
||||
System.err.print("Fatal: ");
|
||||
System.err.println(message);
|
||||
}
|
||||
|
||||
public void fatal(Object message, Throwable t) {
|
||||
System.err.print("Fatal: ");
|
||||
System.err.println(message);
|
||||
t.printStackTrace();
|
||||
}
|
||||
|
||||
public void info(Object message) {
|
||||
if (!this.suppressWarnings)
|
||||
System.out.println(message);
|
||||
}
|
||||
|
||||
public void info(Object message, Throwable t) {
|
||||
if (!this.suppressWarnings) {
|
||||
System.out.println(message);
|
||||
t.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void warn(Object message) {
|
||||
if (!this.suppressWarnings) {
|
||||
System.err.print("Warning: ");
|
||||
System.err.println(message);
|
||||
}
|
||||
}
|
||||
|
||||
public void warn(Object message, Throwable t) {
|
||||
if (!this.suppressWarnings) {
|
||||
System.err.print("Warning: ");
|
||||
System.err.println(message);
|
||||
t.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
protected Logger getLoggerImpl(Class c) {
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setSuppressWarnings(boolean w) {
|
||||
this.suppressWarnings = w;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue