home *** CD-ROM | disk | FTP | other *** search
- package jclass.table;
-
- import java.awt.Component;
- import java.util.Vector;
- import jclass.util.JCVector;
-
- class AddColumn extends Resize {
- private static boolean add(JCTable var0, int var1, int var2, Object var3, Vector var4) {
- if (var2 == Integer.MAX_VALUE) {
- var2 = var0.columns;
- } else if (var2 < 0 || var2 > var0.columns) {
- return false;
- }
-
- if (var1 == 3 && var2 < var0.columns) {
- Shift.columnSeries(var0, var2, 1, var1);
- }
-
- boolean var5 = var4 != null && (var0.validate_policy & 2) != 0;
- JCValidateCellEvent var6 = null;
- if (var5) {
- var6 = new JCValidateCellEvent(var0);
- }
-
- if (var4 != null && var0.cells.size() < var4.size()) {
- var0.cells.setElementAt(var4.size() - 1, new JCVector());
- }
-
- for(int var7 = var4.size(); var7 < var0.rows; ++var7) {
- var4.addElement("");
- }
-
- int var8 = 0;
-
- for(int var9 = 0; var8 < var0.cells.size(); ++var9) {
- JCVector var11 = (JCVector)var0.cells.elementAt(var8);
- JCVector var10;
- if (var11 == null) {
- var0.cells.setElementAt(var8, var10 = new JCVector());
- } else {
- var10 = var11;
- }
-
- if (var2 < ((Vector)var10).size()) {
- ((Vector)var10).insertElementAt((Object)null, var2);
- }
-
- Object var12 = var4 != null && var9 < var4.size() ? var4.elementAt(var9) : null;
- if (var5 && !Validate.value(var0, var6, var8, var2, true, var12)) {
- var12 = null;
- }
-
- var10.setElementAt(var2, var12);
- ++var8;
- }
-
- if (var1 == 3) {
- ++var0.columns;
- }
-
- if (var3 != null) {
- var0.setColumnLabel(var2, var3);
- }
-
- if (((Component)var0).getPeer() == null) {
- return true;
- } else if (!var0.repaint) {
- var0.needs_recalc = true;
- return true;
- } else {
- Size.setDimensions(var0, 3, var0.rows, var0.columns - 1, -998, 0, var2, 1, true);
- Resize.resize_table(var0);
- if (var0.hasText() && var0.edit_column >= var2) {
- var0.cancelEdit(true);
- }
-
- if (((Component)var0).isShowing()) {
- ((Table)var0).repaint();
- }
-
- Resize.redisplayComponents(var0);
- return true;
- }
- }
-
- static boolean add(JCTable var0, int var1, Object var2, Vector var3) {
- return add(var0, 3, var1, var2, var3);
- }
- }
-