001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.modules.visualweb.api.designer;
043:
044: import java.awt.Graphics2D;
045: import org.netbeans.modules.visualweb.designer.DesignerServiceHackProviderImpl;
046: import java.awt.Image;
047: import java.net.URL;
048: import java.util.Map;
049:
050: import org.w3c.dom.DocumentFragment;
051: import org.w3c.dom.Element;
052:
053: /**
054: * XXX Old API, which we wan't to get rid of.
055: * Don't add any new methods here. There should be <code>DesignerService</code>
056: * or <code>DesignerUtilities</code> which will offer stable API.
057: *
058: * @author Peter Zavadsky
059: */
060: public final class DesignerServiceHackProvider {
061:
062: /** Creates a new instance of DesignerServiceHackProvider */
063: private DesignerServiceHackProvider() {
064: }
065:
066: public static Image getCssPreviewImage(
067: /*DataObject dataObject,*/Designer designer,
068: Graphics2D g2d, String cssStyle, String[] cssStyleClasses,
069: /*MarkupDesignBean bean,*/Element componentRootElement,
070: DocumentFragment df, Element element, int width, int height) {
071: return DesignerServiceHackProviderImpl.getCssPreviewImage(
072: /*dataObject,*/designer, g2d, cssStyle,
073: cssStyleClasses,
074: /*bean,*/componentRootElement, df, element, width,
075: height);
076: }
077:
078: public static Image getCssPreviewImage(
079: Map<String, String> properties, URL base, int width,
080: int height, int defaultFontSize) {
081: return DesignerServiceHackProviderImpl.getCssPreviewImage(
082: properties, base, width, height, defaultFontSize);
083: }
084:
085: public static Image getPageBoxPreviewImage(
086: /*DataObject dobj,*/Designer designer, int width,
087: int height) {
088: return DesignerServiceHackProviderImpl.getPageBoxPreviewImage(
089: /*dobj,*/designer, width, height);
090: }
091:
092: // public static boolean canDrop(DataFlavor flavor) {
093: // return DesignerServiceHackProviderImpl.canDrop(flavor);
094: // }
095:
096: // public static void drop(Transferable transferable) {
097: // DesignerServiceHackProviderImpl.drop(transferable);
098: // }
099:
100: // public static void registerTransferable(Transferable transferable) {
101: // DesignerServiceHackProviderImpl.registerTransferable(transferable);
102: // }
103:
104: // public static FileObject getCurrentFile() {
105: // return DesignerServiceHackProviderImpl.getCurrentFile();
106: // }
107:
108: // public static Object getTableInfo(MarkupDesignBean bean) {
109: // public static Object getTableInfo(Element componentRootElement) {
110: // return DesignerServiceHackProviderImpl.getTableInfo(componentRootElement);
111: // }
112: // XXX
113: public static boolean isTableBox(Object box) {
114: return DesignerServiceHackProviderImpl.isTableBox(box);
115: }
116:
117: public static Element getCellElement(Object tableInfo, int row,
118: int column) {
119: return DesignerServiceHackProviderImpl.getCellElement(
120: tableInfo, row, column);
121: }
122:
123: // public static MarkupDesignBean getCellBean(Object tableInfo, int row, int column) {
124: public static Element getCellComponent(Object tableInfo, int row,
125: int column) {
126: return DesignerServiceHackProviderImpl.getCellComponent(
127: tableInfo, row, column);
128: }
129:
130: public static int getColSpan(Object tableInfo, int row, int column) {
131: return DesignerServiceHackProviderImpl.getColSpan(tableInfo,
132: row, column);
133: }
134:
135: public static int getRowSpan(Object tableInfo, int row, int column) {
136: return DesignerServiceHackProviderImpl.getRowSpan(tableInfo,
137: row, column);
138: }
139:
140: public static int getColumnCount(Object tableInfo) {
141: return DesignerServiceHackProviderImpl
142: .getColumnCount(tableInfo);
143: }
144:
145: public static int getRowCount(Object tableInfo) {
146: return DesignerServiceHackProviderImpl.getRowCount(tableInfo);
147: }
148:
149: // public static void notifyCssEdited(DataObject dobj) {
150: // DesignerServiceHackProviderImpl.notifyCssEdited(dobj);
151: // }
152:
153: // public static void refresh(Project project, DataObject dobj, boolean deep) {
154: // DesignerServiceHackProviderImpl.refresh(project, dobj, deep);
155: // }
156: // public static void refreshDataObject(DataObject dobj, boolean deep) {
157: // DesignerServiceHackProviderImpl.refreshDataObject(dobj, deep);
158: // }
159: // public static void refreshProject(Project project, boolean deep) {
160: // DesignerServiceHackProviderImpl.refreshProject(project, deep);
161: // }
162:
163: // public static void destroyWebFormForFileObject(FileObject fo) {
164: // DesignerServiceHackProviderImpl.destroyWebFormForFileObject(fo);
165: // }
166:
167: // public static void copyBoxForElement(Element fromElement, Element toElement) {
168: // DesignerServiceHackProviderImpl.copyBoxForElement(fromElement, toElement);
169: // }
170:
171: // public static FileObject getContextFileForFragmentFile(FileObject fragmentFile) {
172: // return DesignerServiceHackProviderImpl.getContextFileForFragmentFile(fragmentFile);
173: // }
174:
175: // public static FileObject getExternalFormFileForElement(Element element) {
176: // return DesignerServiceHackProviderImpl.getExternalFormFileForElement(element);
177: // }
178:
179: // public static MultiViewElement getDesignerMultiViewElement(DataObject dataObject) {
180: // return DesignerServiceHackProviderImpl.getDesignerMultiViewElement(dataObject);
181: // }
182:
183: }
|