diff --git a/pom.xml b/pom.xml index e8aa62a358..d1783cf140 100644 --- a/pom.xml +++ b/pom.xml @@ -316,7 +316,6 @@ urlfragment-parent wicketstuff-rest-utils wicketstuff-restannotations-parent - whiteboard-parent wicket-mount-parent select2-parent wicketstuff-selectize-parent diff --git a/whiteboard-parent/pom.xml b/whiteboard-parent/pom.xml deleted file mode 100644 index e97363d8b9..0000000000 --- a/whiteboard-parent/pom.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - 4.0.0 - - - org.wicketstuff - wicketstuff-core - 8.0.0-SNAPSHOT - - - wicketstuff-whiteboard-parent - pom - - Wicketstuff Whiteboard - Parent - - Wicket Components for the Whiteboard. - - - - whiteboard - whiteboard-examples - - - diff --git a/whiteboard-parent/whiteboard-examples/pom.xml b/whiteboard-parent/whiteboard-examples/pom.xml deleted file mode 100644 index 268fc867a8..0000000000 --- a/whiteboard-parent/whiteboard-examples/pom.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - 4.0.0 - - - wicketstuff-whiteboard-parent - org.wicketstuff - 8.0.0-SNAPSHOT - - - wicketstuff-whiteboard-examples - war - - Wicketstuff Whiteboard - Examples - - - true - true - true - - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - org.wicketstuff - wicketstuff-whiteboard - ${project.version} - - - org.apache.wicket - wicket-core - - - org.apache.wicket - wicket-native-websocket-javax - ${wicket.version} - - - - org.eclipse.jetty.aggregate - jetty-all - uber - - - - - - - org.apache.maven.plugins - maven-war-plugin - - - org.eclipse.jetty - jetty-maven-plugin - - - - 8080 - 60000 - - - stop - 8089 - - - - - diff --git a/whiteboard-parent/whiteboard-examples/src/main/java/org/wicketstuff/whiteboard/sample/HomePage.html b/whiteboard-parent/whiteboard-examples/src/main/java/org/wicketstuff/whiteboard/sample/HomePage.html deleted file mode 100644 index 26670b98d1..0000000000 --- a/whiteboard-parent/whiteboard-examples/src/main/java/org/wicketstuff/whiteboard/sample/HomePage.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - -
-
Whiteboard
-
-
- - diff --git a/whiteboard-parent/whiteboard-examples/src/main/java/org/wicketstuff/whiteboard/sample/HomePage.java b/whiteboard-parent/whiteboard-examples/src/main/java/org/wicketstuff/whiteboard/sample/HomePage.java deleted file mode 100644 index 5948a211c1..0000000000 --- a/whiteboard-parent/whiteboard-examples/src/main/java/org/wicketstuff/whiteboard/sample/HomePage.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.sample; - -import java.io.BufferedReader; -import java.io.InputStream; -import java.io.InputStreamReader; - -import org.apache.wicket.markup.html.WebPage; -import org.apache.wicket.request.mapper.parameter.PageParameters; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.wicketstuff.whiteboard.Whiteboard; -import org.wicketstuff.whiteboard.WhiteboardBehavior; - -/** - * Sample application which shows the features of the whiteboard - * @author andunslg - */ -public class HomePage extends WebPage { - private static final long serialVersionUID = 1L; - private static final Logger log = LoggerFactory.getLogger(WhiteboardBehavior.class); - - public HomePage() { - this(new PageParameters()); - } - - public HomePage(final PageParameters parameters) { - super(parameters); - - //Reading a json file which represent a previously saved whiteboard - String content = ""; - InputStream savedWhiteboard = this.getClass().getResourceAsStream("Whiteboard_Example.json"); - - try (BufferedReader reader = new BufferedReader(new InputStreamReader(savedWhiteboard))) { - String line = reader.readLine(); - while (line != null) { - content += line; - line = reader.readLine(); - } - } catch (Exception e) { - log.error("Unexpected error: ", e); - } finally { - Whiteboard whiteboard = new Whiteboard("whiteboard_example_1","whiteboardContainer", content, "ClipArts", "Documents"); - this.add(whiteboard); - } - - } - -} diff --git a/whiteboard-parent/whiteboard-examples/src/main/java/org/wicketstuff/whiteboard/sample/WicketApplication.java b/whiteboard-parent/whiteboard-examples/src/main/java/org/wicketstuff/whiteboard/sample/WicketApplication.java deleted file mode 100644 index 1db3f7282a..0000000000 --- a/whiteboard-parent/whiteboard-examples/src/main/java/org/wicketstuff/whiteboard/sample/WicketApplication.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.wicketstuff.whiteboard.sample; - -import org.apache.wicket.markup.html.WebPage; -import org.apache.wicket.protocol.http.WebApplication; - -/** - * Application object for your web application. If you want to run this application without deploying, run the Start - * class. - */ -public class WicketApplication extends WebApplication{ - /** - * @see org.apache.wicket.Application#getHomePage() - */ - @Override - public Class getHomePage(){ - return HomePage.class; - } - - /** - * @see org.apache.wicket.Application#init() - */ - @Override - public void init(){ - super.init(); - } -} diff --git a/whiteboard-parent/whiteboard-examples/src/main/resources/log4j.properties b/whiteboard-parent/whiteboard-examples/src/main/resources/log4j.properties deleted file mode 100644 index c7e67e698a..0000000000 --- a/whiteboard-parent/whiteboard-examples/src/main/resources/log4j.properties +++ /dev/null @@ -1,10 +0,0 @@ -log4j.rootLogger=INFO - -log4j.logger.org.apache.wicket=INFO -log4j.logger.org.apache.wicket.protocol.http.HttpSessionStore=INFO -log4j.logger.org.apache.wicket.version=INFO -log4j.logger.org.apache.wicket.RequestCycle=INFO - -log4j.category.com.googlecode.wicket.jquery.ui.plugins.whiteboard=DEBUG - - diff --git a/whiteboard-parent/whiteboard-examples/src/main/resources/org/wicketstuff/whiteboard/sample/Whiteboard_Example.json b/whiteboard-parent/whiteboard-examples/src/main/resources/org/wicketstuff/whiteboard/sample/Whiteboard_Example.json deleted file mode 100644 index 041b57f67e..0000000000 --- a/whiteboard-parent/whiteboard-examples/src/main/resources/org/wicketstuff/whiteboard/sample/Whiteboard_Example.json +++ /dev/null @@ -1,69 +0,0 @@ -{"background": { - "height": 326, - "width": 595.0481927710844, - "left": -297.5240963855422, - "type": "Background", - "url": "http://localhost:8080/Documents/gmaps.jpg", - "top": 163 -}, "elements": [ - { - "id": 5, - "p2": 4, - "color": "", - "p1": 3, - "trace": false, - "hidden": false, - "label": "", - "type": "PencilCircle" - }, - { - "id": 0, - "color": "", - "trace": false, - "hidden": false, - "label": "", - "type": "PointFree", - "y": 105, - "x": -527 - }, - { - "id": 2, - "p2": 1, - "color": "", - "p1": 0, - "trace": false, - "hidden": false, - "label": "", - "type": "PencilRect" - }, - { - "id": 1, - "color": "", - "trace": false, - "hidden": false, - "label": "", - "type": "PointFree", - "y": -100, - "x": -157 - }, - { - "id": 3, - "color": "", - "trace": false, - "hidden": false, - "label": "", - "type": "PointFree", - "y": 96, - "x": 61 - }, - { - "id": 4, - "color": "", - "trace": false, - "hidden": false, - "label": "", - "type": "PointFree", - "y": 78, - "x": 88 - } -]} \ No newline at end of file diff --git a/whiteboard-parent/whiteboard-examples/src/main/webapp/ClipArts/NodeJS.png b/whiteboard-parent/whiteboard-examples/src/main/webapp/ClipArts/NodeJS.png deleted file mode 100644 index f9fefa7690..0000000000 Binary files a/whiteboard-parent/whiteboard-examples/src/main/webapp/ClipArts/NodeJS.png and /dev/null differ diff --git a/whiteboard-parent/whiteboard-examples/src/main/webapp/ClipArts/Twitter.jpg b/whiteboard-parent/whiteboard-examples/src/main/webapp/ClipArts/Twitter.jpg deleted file mode 100644 index 846669283d..0000000000 Binary files a/whiteboard-parent/whiteboard-examples/src/main/webapp/ClipArts/Twitter.jpg and /dev/null differ diff --git a/whiteboard-parent/whiteboard-examples/src/main/webapp/ClipArts/mysql.jpg b/whiteboard-parent/whiteboard-examples/src/main/webapp/ClipArts/mysql.jpg deleted file mode 100644 index cc4d22c89a..0000000000 Binary files a/whiteboard-parent/whiteboard-examples/src/main/webapp/ClipArts/mysql.jpg and /dev/null differ diff --git a/whiteboard-parent/whiteboard-examples/src/main/webapp/Documents/MongoMapReduce.jpg b/whiteboard-parent/whiteboard-examples/src/main/webapp/Documents/MongoMapReduce.jpg deleted file mode 100644 index 5d5528297f..0000000000 Binary files a/whiteboard-parent/whiteboard-examples/src/main/webapp/Documents/MongoMapReduce.jpg and /dev/null differ diff --git a/whiteboard-parent/whiteboard-examples/src/main/webapp/Documents/gmaps.jpg b/whiteboard-parent/whiteboard-examples/src/main/webapp/Documents/gmaps.jpg deleted file mode 100644 index 2256927572..0000000000 Binary files a/whiteboard-parent/whiteboard-examples/src/main/webapp/Documents/gmaps.jpg and /dev/null differ diff --git a/whiteboard-parent/whiteboard-examples/src/main/webapp/Documents/gmaps_1.jpg b/whiteboard-parent/whiteboard-examples/src/main/webapp/Documents/gmaps_1.jpg deleted file mode 100644 index d4468eff18..0000000000 Binary files a/whiteboard-parent/whiteboard-examples/src/main/webapp/Documents/gmaps_1.jpg and /dev/null differ diff --git a/whiteboard-parent/whiteboard-examples/src/main/webapp/WEB-INF/web.xml b/whiteboard-parent/whiteboard-examples/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 3b80274585..0000000000 --- a/whiteboard-parent/whiteboard-examples/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - whiteboard-examples - - - - - - - - - - - wicket.Whiteboard.WebSocket - org.apache.wicket.protocol.ws.javax.JavaxWebSocketFilter - - applicationClassName - org.wicketstuff.whiteboard.sample.WicketApplication - - - ignorePaths - - conf,css,default,docs,images,js,persistence,public,screensharing,streams,upload,uploadtemp,services,networktest.,file.,remotelog.,screen.,DownloadHandler - - - - - - - - - - - wicket.Whiteboard.WebSocket - /* - - diff --git a/whiteboard-parent/whiteboard/pom.xml b/whiteboard-parent/whiteboard/pom.xml deleted file mode 100644 index fcc5d777a2..0000000000 --- a/whiteboard-parent/whiteboard/pom.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - 4.0.0 - - - wicketstuff-whiteboard-parent - org.wicketstuff - 8.0.0-SNAPSHOT - - - wicketstuff-whiteboard - jar - - Wicketstuff Whiteboard - - - - The Apache Software License, Version 2.0 - http://www.apache.org/licenses/LICENSE-2.0.txt - repo - - - - - - org.apache.wicket - wicket-core - - - org.apache.wicket - wicket-native-websocket-javax - ${wicket.version} - - - - org.slf4j - slf4j-api - - - javax.servlet - javax.servlet-api - provided - - - - - - - false - src/main/resources - - - false - src/main/java - - ** - - - **/*.java - - - - - diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/Background.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/Background.java deleted file mode 100644 index c1e0993d30..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/Background.java +++ /dev/null @@ -1,116 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard; - -import com.github.openjson.JSONException; -import com.github.openjson.JSONObject; - -/** - * This class represent the background image of the whiteboard - * - * @author andunslg - */ -public class Background { - private String type; - private String url; - private Double width; - private Double height; - private Double left; - private Double top; - - public Background(String type, String url, Double width, Double height, Double left, Double top) { - this.type = type; - this.url = url; - this.width = width; - this.height = height; - this.left = left; - this.top = top; - } - - public Background(JSONObject object) throws JSONException { - this.type = "Background"; - this.url = object.getString("url"); - this.width = object.getDouble("width"); - this.height = object.getDouble("height"); - this.left = object.getDouble("left"); - this.top = object.getDouble("top"); - } - - /** - * Return a JSON object which represent the Background - * - * @return JSON object which represent the Background - * @throws JSONException - */ - public JSONObject getJSON() throws JSONException { - return new JSONObject() - .put("url", url) - .put("type", type) - .put("width", width) - .put("height", height) - .put("left", left) - .put("top", top); - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getUrl() { - return url; - } - - public void setUrl(String url) { - this.url = url; - } - - public Double getWidth() { - return width; - } - - public void setWidth(Double width) { - this.width = width; - } - - public Double getHeight() { - return height; - } - - public void setHeight(Double height) { - this.height = height; - } - - public Double getLeft() { - return left; - } - - public void setLeft(Double left) { - this.left = left; - } - - public Double getTop() { - return top; - } - - public void setTop(Double top) { - this.top = top; - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/Whiteboard.html b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/Whiteboard.html deleted file mode 100644 index 15fc0e34b5..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/Whiteboard.html +++ /dev/null @@ -1,27 +0,0 @@ - - - - -
- -
- diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/Whiteboard.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/Whiteboard.java deleted file mode 100644 index 0f2aae7f15..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/Whiteboard.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard; - -import org.apache.wicket.markup.html.WebMarkupContainer; -import org.apache.wicket.markup.html.panel.Panel; -import org.apache.wicket.protocol.ws.api.WebSocketBehavior; -import org.apache.wicket.protocol.ws.api.message.ClosedMessage; -import org.apache.wicket.protocol.ws.api.message.ConnectedMessage; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -/** - * This is the whiteboard main class - * - * @author andunslg - */ -public class Whiteboard extends Panel { - private static final Logger log = LoggerFactory.getLogger(Whiteboard.class); - private static final long serialVersionUID = 1L; - - /** - * This is the constructor which used to create a whiteboard in a wicket application - * - * @param markupId - * html element markupId which holds the whiteboard - * @param whiteboardContent - * If loading from a saved whiteboard file, content should be provided as a string. Otherwise null - * @param clipArtFolderPath - * Path of the folder which holds clipArts which can be added to whiteboard. Relative to context root - * @param docFolderPath - * Path of the folder which holds docs images which can be added to whiteboard. Relative to context root - */ - public Whiteboard(String whiteboardID, String markupId, String whiteboardContent, String clipArtFolderPath, - String docFolderPath) { - super(markupId); - - // Adding Web Socket behaviour to handle synchronization between whiteboards - - this.add(new WebSocketBehavior() { - private static final long serialVersionUID = -3311970325911992958L; - - @Override - protected void onConnect(ConnectedMessage message) { - super.onConnect(message); - log.debug("Connecting :" + message.toString()); - } - - @Override - protected void onClose(ClosedMessage message) { - super.onClose(message); - log.debug("Disconnecting :" + message.toString()); - } - }); - - add(new WebMarkupContainer("whiteboard")); - add(new WhiteboardBehavior(whiteboardID, "whiteboard", whiteboardContent, clipArtFolderPath, docFolderPath)); - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/WhiteboardBehavior.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/WhiteboardBehavior.java deleted file mode 100644 index 80b0a5f38d..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/WhiteboardBehavior.java +++ /dev/null @@ -1,918 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.text.DateFormat; -import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeMap; -import java.util.concurrent.BlockingDeque; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.LinkedBlockingDeque; - -import javax.servlet.ServletContext; -import javax.servlet.http.HttpServletRequest; - -import org.apache.wicket.Application; -import org.apache.wicket.Component; -import org.apache.wicket.ajax.AbstractDefaultAjaxBehavior; -import org.apache.wicket.ajax.AjaxRequestTarget; -import org.apache.wicket.markup.head.CssHeaderItem; -import org.apache.wicket.markup.head.IHeaderResponse; -import org.apache.wicket.markup.head.JavaScriptHeaderItem; -import org.apache.wicket.markup.head.OnDomReadyHeaderItem; -import org.apache.wicket.markup.head.PriorityHeaderItem; -import org.apache.wicket.protocol.http.WebApplication; -import org.apache.wicket.protocol.ws.WebSocketSettings; -import org.apache.wicket.protocol.ws.api.IWebSocketConnection; -import org.apache.wicket.protocol.ws.api.registry.IWebSocketConnectionRegistry; -import org.apache.wicket.request.Url; -import org.apache.wicket.request.cycle.RequestCycle; -import org.apache.wicket.request.http.WebRequest; -import org.apache.wicket.util.string.Strings; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.wicketstuff.whiteboard.elements.CircleGeneral; -import org.wicketstuff.whiteboard.elements.Circle_3p; -import org.wicketstuff.whiteboard.elements.ClipArt; -import org.wicketstuff.whiteboard.elements.Element; -import org.wicketstuff.whiteboard.elements.Element.Type; -import org.wicketstuff.whiteboard.elements.LineGeneral; -import org.wicketstuff.whiteboard.elements.Line_2p; -import org.wicketstuff.whiteboard.elements.PencilArrow; -import org.wicketstuff.whiteboard.elements.PencilCircle; -import org.wicketstuff.whiteboard.elements.PencilCurve; -import org.wicketstuff.whiteboard.elements.PencilFreeLine; -import org.wicketstuff.whiteboard.elements.PencilPointAtRect; -import org.wicketstuff.whiteboard.elements.PencilPointer; -import org.wicketstuff.whiteboard.elements.PencilRect; -import org.wicketstuff.whiteboard.elements.PencilUnderline; -import org.wicketstuff.whiteboard.elements.PointAtCircle; -import org.wicketstuff.whiteboard.elements.PointAtLine; -import org.wicketstuff.whiteboard.elements.PointFree; -import org.wicketstuff.whiteboard.elements.Point_2c; -import org.wicketstuff.whiteboard.elements.Point_2l; -import org.wicketstuff.whiteboard.elements.Point_lc; -import org.wicketstuff.whiteboard.elements.Segment; -import org.wicketstuff.whiteboard.elements.Text; -import org.wicketstuff.whiteboard.resource.GoogStyleSheetResourceReference; -import org.wicketstuff.whiteboard.resource.TranslateJavaScriptResourceReference; -import org.wicketstuff.whiteboard.resource.WhiteboardHelperJavaScriptResourceReference; -import org.wicketstuff.whiteboard.resource.WhiteboardJavaScriptResourceReference; -import org.wicketstuff.whiteboard.resource.WhiteboardStyleSheetResourceReference; -import org.wicketstuff.whiteboard.settings.WhiteboardLibrarySettings; - -import com.github.openjson.JSONArray; -import com.github.openjson.JSONException; -import com.github.openjson.JSONObject; - -/** - * This class is the behaviour handler of the whiteboard. All the server-side functionality of whiteboard is handled - * here - * - * @author andunslg - */ -public class WhiteboardBehavior extends AbstractDefaultAjaxBehavior { - private static final Map whiteboardMap = new ConcurrentHashMap<>(); - - private static final Logger log = LoggerFactory.getLogger(WhiteboardBehavior.class); - private static final long serialVersionUID = 1L; - private String markupId; - private String whiteboardId; - - private Map elementMap; - private Map loadedElementMap; - - private BlockingDeque> undoSnapshots; - private BlockingDeque> undoSnapshotCreationList; - - private List snapShot = new ArrayList<>(); - private List snapShotCreation = new ArrayList<>(); - - private DateFormat dateFormat = new SimpleDateFormat("yyyy_MM_dd_HH_mm_ss"); - - private ArrayList clipArts; - private String clipArtFolder; - - private Map> docMap; - private String documentFolder; - - private Background background; - - private BlockingDeque undoSnapshots_Background; - private BlockingDeque undoSnapshotCreationList_Background; - - private BlockingDeque isElementSnapshotList; - - private String loadedContent = ""; - - /** - * Creating the behaviour using whiteboard's html element id - * - * @param whiteboardMarkupId - */ - public WhiteboardBehavior(String whiteboardObjectId, String whiteboardMarkupId) { - this(whiteboardObjectId, whiteboardMarkupId, null, null, null); - } - - /** - * This is the constructor which used to create a whiteboard behaviour with more features - * - * @param markupId - * html element id which holds the whiteboard - * @param whiteboardContent - * If loading from a saved whiteboard file, content should be provided as a string. Otherwise null - * @param clipArtFolder - * Path of the folder which holds clipArts which can be added to whiteboard. Relative to context root - * @param documentFolder - * Path of the folder which holds docs images which can be added to whiteboard. Relative to context root - */ - public WhiteboardBehavior(String whiteboardId, String markupId, String whiteboardContent, String clipArtFolder, String documentFolder) { - super(); - this.whiteboardId = whiteboardId; - this.markupId = markupId; - - if (!whiteboardMap.containsKey(whiteboardId)) { - elementMap = new ConcurrentHashMap<>(); - loadedElementMap = new ConcurrentHashMap<>(); - - undoSnapshots = new LinkedBlockingDeque<>(20); - undoSnapshotCreationList = new LinkedBlockingDeque<>(20); - - undoSnapshots_Background = new LinkedBlockingDeque<>(20); - undoSnapshotCreationList_Background = new LinkedBlockingDeque<>(20); - - isElementSnapshotList = new LinkedBlockingDeque<>(20); - - clipArts = new ArrayList<>(); - docMap = new ConcurrentHashMap<>(); - - loadedContent = whiteboardContent; - - WhiteboardData whiteboardData = new WhiteboardData(elementMap, loadedElementMap, undoSnapshots, - undoSnapshotCreationList, undoSnapshots_Background, undoSnapshotCreationList_Background, - isElementSnapshotList, clipArts, null, docMap, null, null, whiteboardContent); - whiteboardMap.put(whiteboardId, whiteboardData); - } else { - WhiteboardData whiteboardData = whiteboardMap.get(whiteboardId); - elementMap = whiteboardData.getElementMap(); - loadedElementMap = whiteboardData.getLoadedElementMap(); - - undoSnapshots = whiteboardData.getUndoSnapshots(); - undoSnapshotCreationList = whiteboardData.getUndoSnapshotCreationList(); - - clipArts = whiteboardData.getClipArts(); - docMap = whiteboardData.getDocMap(); - - this.clipArtFolder = whiteboardData.getClipArtFolder(); - this.documentFolder = whiteboardData.getDocumentFolder(); - background = whiteboardData.getBackground(); - loadedContent = whiteboardData.getLoadedContent(); - - undoSnapshots_Background = whiteboardData.getUndoSnapshots_Background(); - undoSnapshotCreationList_Background = whiteboardData.getUndoSnapshotCreationList_Background(); - - isElementSnapshotList = whiteboardData.getIsElementSnapshotList(); - } - - if (!Strings.isEmpty(loadedContent)) { - whiteboardMap.get(whiteboardId).setLoadedContent(loadedContent); - if (whiteboardContent != null && !whiteboardContent.equals("")) { - try { - JSONObject savedContent = new JSONObject(whiteboardContent); - - JSONArray elementList = savedContent.getJSONArray("elements"); - snapShot = new ArrayList<>(); - snapShotCreation = new ArrayList<>(); - - for (int i = 0; i < elementList.length(); i++) { - JSONObject jElement = (JSONObject) elementList.get(i); - - Element element = getElementObject(jElement); - - if (element != null) { - elementMap.put(element.getId(), element); - loadedElementMap.put(element.getId(), element); - snapShot.add(element); - snapShotCreation.add(true); - } - } - if (undoSnapshots.isEmpty()) { - addUndo(undoSnapshots, snapShot); - addUndo(undoSnapshotCreationList, snapShotCreation); - addUndo(isElementSnapshotList, true); - } - - snapShot = null; - snapShotCreation = null; - - if (savedContent.has("background")) { - JSONObject backgroundJSON = savedContent.getJSONObject("background"); - background = new Background(backgroundJSON); - whiteboardMap.get(whiteboardId).setBackground(background); - addUndo(undoSnapshots_Background, new Background("Background", "", 0.0, 0.0, 0.0, 0.0)); - addUndo(undoSnapshotCreationList_Background, true); - addUndo(isElementSnapshotList, false); - } - - } catch (JSONException e) { - log.error("Unexpected error while constructing WhiteboardBehavior", e); - } - } - } - - // Setting the path to clipArt folder - if (clipArtFolder != null && !clipArtFolder.equals("")) { - this.clipArtFolder = clipArtFolder; - whiteboardMap.get(whiteboardId).setClipArtFolder(clipArtFolder); - this.loadClipArts(); - } - - // Setting the path to documents folder - if (documentFolder != null && !documentFolder.equals("")) { - this.documentFolder = documentFolder; - whiteboardMap.get(whiteboardId).setDocumentFolder(documentFolder); - this.loadDocuments(); - } - } - - /** - * This method handles all the Ajax calls coming from whiteboard - * - * @param target - */ - @Override - protected void respond(final AjaxRequestTarget target) { - - RequestCycle cycle = RequestCycle.get(); - WebRequest webRequest = (WebRequest) cycle.getRequest(); - - // If geometric element is drawn of edited on whiteboard, message will be sent and this if clause handles that - if (webRequest.getQueryParameters().getParameterNames().contains("editedElement")) { - String editedElement = webRequest.getQueryParameters().getParameterValue("editedElement").toString(); - handleEditedElement(editedElement); - } - // If undo button is clicked on whiteboard, message will be sent and this if clause handles that - else if (webRequest.getQueryParameters().getParameterNames().contains("undo")) { - handleUndo(); - } - // If eraseAll button is clicked on whiteboard, message will be sent and this if clause handles that - else if (webRequest.getQueryParameters().getParameterNames().contains("eraseAll")) { - handleEraseAll(); - } - // If save button is clicked on whiteboard, message will be sent and this if clause handles that - else if (webRequest.getQueryParameters().getParameterNames().contains("save")) { - handleSave(); - } - // If addClipArt button is clicked on whiteboard, message will be sent and this if clause handles that - else if (webRequest.getQueryParameters().getParameterNames().contains("clipArt")) { - handleClipArts(); - } - // If addDocument button is clicked on whiteboard, message will be sent and this if clause handles that - else if (webRequest.getQueryParameters().getParameterNames().contains("docList")) { - handleDocs(); - } - // If document page navigation buttons are clicked on whiteboard, message will be sent and this if clause - // handles that - else if (webRequest.getQueryParameters().getParameterNames().contains("docComponents")) { - String docBaseName = webRequest.getQueryParameters().getParameterValue("docBaseName").toString(); - handleDocComponents(docBaseName); - } - // If document is added to whiteboard, message will be sent and this if clause handles that - else if (webRequest.getQueryParameters().getParameterNames().contains("background")) { - String backgroundString = webRequest.getQueryParameters().getParameterValue("background").toString(); - handleBackground(backgroundString); - } - } - - /** - * Mapping JSON String to Objects and Adding to the Element List - * - * @param editedElement - * @return - */ - private boolean handleEditedElement(String editedElement) { - try { - JSONObject jsonEditedElement = new JSONObject(editedElement); - Element element = getElementObject(jsonEditedElement); - - boolean isLoaded = false; - - if (!elementMap.isEmpty() && loadedElementMap.get(element.getId()) != null && !loadedElementMap.isEmpty()) { - isLoaded = isEqual(element.getJSON(), loadedElementMap.get(element.getId()).getJSON()); - } - - // If the edited element is not from file loaded content this clause executes - if (!isLoaded) { - // Adding the element creation/editing is add to the undo snapshots - if (snapShot == null && snapShotCreation == null) { - snapShot = new ArrayList<>(); - snapShotCreation = new ArrayList<>(); - } - if (elementMap.containsKey(element.getId()) && !elementMap.isEmpty()) { - snapShot.add(elementMap.get(element.getId())); - snapShotCreation.add(false); - } else { - snapShot.add(element); - snapShotCreation.add(true); - } - if (Type.PointFree != element.getType()) { - if (undoSnapshots.size() == 20) { - undoSnapshots.pollFirst(); - undoSnapshotCreationList.pollFirst(); - } - if (Type.PencilCurve == element.getType()) { - List lastElementSnapshot = undoSnapshots.peekLast(); - if (lastElementSnapshot != null) { - Element lastSnapshotElement = lastElementSnapshot.get(lastElementSnapshot.size() - 1); - - if ((lastSnapshotElement instanceof PencilCurve) && (lastSnapshotElement.getId() == element.getId())) { - List lastCreationSnapshot = undoSnapshotCreationList.getLast(); - - for (int i = 0; i < snapShot.size(); i++) { - lastElementSnapshot.add(snapShot.get(i)); - lastCreationSnapshot.add(snapShotCreation.get(i)); - } - } else { - addUndo(undoSnapshots, snapShot); - addUndo(undoSnapshotCreationList, snapShotCreation); - addUndo(isElementSnapshotList, true); - } - } - } else if (Type.ClipArt == element.getType()) { - List snapShotTemp = undoSnapshots.pollLast(); - List snapShotCreationTemp = undoSnapshotCreationList.pollLast(); - - for (int i = 0; i < snapShotTemp.size(); i++) { - snapShot.add(snapShotTemp.get(i)); - snapShotCreation.add(snapShotCreationTemp.get(i)); - } - addUndo(undoSnapshots, snapShot); - addUndo(undoSnapshotCreationList, snapShotCreation); - addUndo(isElementSnapshotList, true); - } else { - addUndo(undoSnapshots, snapShot); - addUndo(undoSnapshotCreationList, snapShotCreation); - addUndo(isElementSnapshotList, true); - } - - snapShot = null; - snapShotCreation = null; - } - - // Synchronizing newly added/edited element between whiteboard clients - if (element != null) { - elementMap.put(element.getId(), element); - - JSONObject jsonObject = new JSONObject(editedElement); - sendWb(getAddElementMessage(jsonObject)); - } - } - return true; - } catch (JSONException e) { - log.error("Unexpected error while editing element", e); - } - return false; - } - - /** - * Synchronizing newly added/edited background between whiteboard clients - * - * @param backgroundString - * @return - */ - private boolean handleBackground(String backgroundString) { - try { - JSONObject backgroundJSON = new JSONObject(backgroundString); - Background backgroundObject = new Background(backgroundJSON); - background = backgroundObject; - - Background previousBackground = new Background("Background", "", 0.0, 0.0, 0.0, 0.0); - if (whiteboardMap.get(whiteboardId).getBackground() != null) { - previousBackground = whiteboardMap.get(whiteboardId).getBackground(); - } - whiteboardMap.get(whiteboardId).setBackground(background); - - undoSnapshotCreationList_Background.addLast(previousBackground == null); - undoSnapshots_Background.addLast(previousBackground); - isElementSnapshotList.addLast(false); - - JSONObject jsonObject = new JSONObject(backgroundString); - sendWb(getAddBackgroundMessage(jsonObject)); - return true; - } catch (JSONException e) { - log.error("Unexpected error while handling background", e); - } - return false; - } - - /** - * Undo one step and synchronizing undo between whiteboard clients - * - * @return - */ - private boolean handleUndo() { - if (!isElementSnapshotList.isEmpty()) { - if (isElementSnapshotList.pollLast()) { - List undoCreationList = undoSnapshotCreationList.pollLast(); - List undoElement = undoSnapshots.pollLast(); - - String deleteList = ""; - JSONArray changeList = new JSONArray(); - - for (int i = 0; i < undoElement.size(); i++) { - if (undoCreationList.get(i)) { - elementMap.remove(undoElement.get(i).getId()); - if (loadedElementMap.containsKey(undoElement.get(i).getId())) { - loadedContent = ""; - whiteboardMap.get(whiteboardId).setLoadedContent(""); - loadedElementMap.remove(undoElement.get(i).getId()); - } - if ("".equals(deleteList)) { - deleteList = "" + undoElement.get(i).getId(); - } else { - deleteList += "," + undoElement.get(i).getId(); - } - } else { - elementMap.put(undoElement.get(i).getId(), undoElement.get(i)); - try { - changeList.put(undoElement.get(i).getJSON()); - } catch (JSONException e) { - log.error("Unexpected error while getting JSON", e); - } - } - } - - sendWb(getUndoMessage(changeList, deleteList)); - } else { - Background prevBg = undoSnapshots_Background.pollLast(); - background = prevBg; - whiteboardMap.get(whiteboardId).setBackground(prevBg); - - sendWb(getAddBackgroundMessage(prevBg == null ? new JSONObject() : prevBg.getJSON())); - } - return true; - } - return false; - } - - /** - * Synchronizing eraseAll request between whiteboard clients - * - * @return - */ - private boolean handleEraseAll() { - elementMap.clear(); - sendWb(getEraseAllMessage(new JSONArray())); - return true; - } - - /** - * Save the whiteboard content to a file - * - * @return - */ - private boolean handleSave() { - ServletContext servletContext = WebApplication.get().getServletContext(); - String saveFolderPath = servletContext.getRealPath("") + "/Saved_Whiteboards"; - - File saveFolder = new File(saveFolderPath); - if (!saveFolder.exists()) { - saveFolder.mkdir(); - } - - boolean result = false; - JSONObject saveObject = new JSONObject(); - - JSONArray elementArray = new JSONArray(); - for (int elementID : elementMap.keySet()) { - try { - elementArray.put(elementMap.get(elementID).getJSON()); - } catch (JSONException e) { - log.error("Unexpected error while getting JSON", e); - } - } - JSONObject backgroundJSON = null; - if (background != null) { - try { - backgroundJSON = background.getJSON(); - } catch (JSONException e) { - log.error("Unexpected error while getting JSON", e); - } - } - - try { - saveObject.put("elements", elementArray); - if (backgroundJSON != null) { - saveObject.put("background", backgroundJSON); - } - } catch (JSONException e) { - log.error("Unexpected error while getting JSON", e); - } - - File whiteboardFile = new File(saveFolderPath + "/Whiteboard_" + dateFormat.format(new Date()) + ".json"); - - try (FileWriter writer = new FileWriter(whiteboardFile)) { - whiteboardFile.createNewFile(); - log.debug("Going to dump WB to file: " + whiteboardFile.getAbsolutePath()); - writer.write(saveObject.toString()); - writer.flush(); - result = true; - } catch (IOException e) { - log.debug("Unexpected error during dumping WB to file ", e); - } - return result; - } - - /** - * Load the clipArts list from the clipArt folder and synchronizing the list between whiteboard clients - */ - private void handleClipArts() { - loadClipArts(); - JSONArray jsonArray = new JSONArray(); - for (String clipArtURL : clipArts) { - jsonArray.put(clipArtURL); - } - sendWb(getClipArtListMessage(jsonArray)); - } - - /** - * Load the documents list from the documents folder and synchronizing the list between whiteboard clients - */ - private void handleDocs() { - loadDocuments(); - JSONArray jsonArray = new JSONArray(); - Set keySet = docMap.keySet(); - for (String key : keySet) { - jsonArray.put(docMap.get(key).get(0)); - } - sendWb(getDocumentListMessage(jsonArray)); - } - - /** - * Load the components of a particular document from the documents folder and synchronizing the list between - * whiteboard clients - * - * @param docBaseName - */ - private void handleDocComponents(String docBaseName) { - loadDocuments(); - JSONArray jsonArray = new JSONArray(); - for (String url : docMap.get(docBaseName)) { - jsonArray.put(url); - } - sendWb(getDocumentComponentListMessage(jsonArray)); - } - - private static void sendWb(JSONObject obj) { - IWebSocketConnectionRegistry reg = WebSocketSettings.Holder.get(Application.get()).getConnectionRegistry(); - for (IWebSocketConnection c : reg.getConnections(Application.get())) { - try { - c.sendMessage(obj.toString()); - } catch (Exception e) { - log.error("Unexpected error while sending message through the web socket", e); - } - } - } - - private static JSONObject getAddElementMessage(JSONObject element) throws JSONException { - return new JSONObject().put("type", "addElement").put("json", element); - } - - private static JSONObject getAddBackgroundMessage(JSONObject element) throws JSONException { - return new JSONObject().put("type", "addBackground").put("json", element); - } - - private static JSONObject getUndoMessage(JSONArray changeList, String deleteList) throws JSONException { - return new JSONObject().put("type", "undoList").put("changeList", changeList).put("deleteList", deleteList); - } - - /* commented for now - private JSONObject getWhiteboardMessage(JSONArray array) throws JSONException { - return new JSONObject().put("type", "parseWB").put("json", array); - } - */ - - private static JSONObject getEraseAllMessage(JSONArray array) throws JSONException { - return new JSONObject().put("type", "eraseElements").put("json", array); - } - - private static JSONObject getClipArtListMessage(JSONArray array) throws JSONException { - return new JSONObject().put("type", "clipArtList").put("json", array); - } - - private static JSONObject getDocumentListMessage(JSONArray array) throws JSONException { - return new JSONObject().put("type", "documentList").put("json", array); - } - - private static JSONObject getDocumentComponentListMessage(JSONArray array) throws JSONException { - return new JSONObject().put("type", "documentComponentList").put("json", array); - } - - @Override - public void renderHead(Component component, IHeaderResponse response) { - super.renderHead(component, response); - - initReferences(response); - - try { - // Synchronizing existing content between clients - JSONArray elements = null; - if (!elementMap.isEmpty()) { - Map sortedElementList = new TreeMap<>(elementMap); - elements = new JSONArray(); - for (Element e : sortedElementList.values()) { - elements.put(e.getJSON()); - } - } - - response.render(OnDomReadyHeaderItem.forScript(String.format("initWB('%s', '%s', %s, %s);", getCallbackUrl(), markupId - , elements, background == null ? null : background.getJSON()))); - } catch (JSONException e) { - log.error("Unexpected error while getting JSON", e); - } - } - - /** - * Loading default resources which need to whiteboard - * - * @param response - */ - private static void initReferences(IHeaderResponse response) { - WhiteboardLibrarySettings settings = getLibrarySettings(); - - // Whiteboard.css - if (settings != null && settings.getWhiteboardStyleSheetReference() != null) { - response.render(new PriorityHeaderItem(CssHeaderItem.forReference(settings.getWhiteboardStyleSheetReference()))); - } else { - response.render(new PriorityHeaderItem(CssHeaderItem.forReference(WhiteboardStyleSheetResourceReference.get()))); - } - - // Goog.css - if (settings != null && settings.getGoogStyleSheetReference() != null) { - response.render(new PriorityHeaderItem(CssHeaderItem.forReference(settings.getGoogStyleSheetReference()))); - } else { - response.render(new PriorityHeaderItem(CssHeaderItem.forReference(GoogStyleSheetResourceReference.get()))); - } - - // translate.js - if (settings != null && settings.getTranslateJavaScriptReference() != null) { - response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forReference(settings.getTranslateJavaScriptReference()))); - } else { - response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forReference(TranslateJavaScriptResourceReference.get()))); - } - - // whiteboard.js - if (settings != null && settings.getWhiteboardJavaScriptReference() != null) { - response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forReference(settings.getWhiteboardJavaScriptReference()))); - } else { - response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forReference(WhiteboardJavaScriptResourceReference.get()))); - } - - // wb-helper.js - if (settings != null && settings.getWhiteboardHelperJavaScriptReference() != null) { - response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forReference(settings.getWhiteboardHelperJavaScriptReference()))); - } else { - response.render(new PriorityHeaderItem(JavaScriptHeaderItem.forReference(WhiteboardHelperJavaScriptResourceReference.get()))); - } - } - - private static WhiteboardLibrarySettings getLibrarySettings() { - if (Application.exists() && (Application.get().getJavaScriptLibrarySettings() instanceof WhiteboardLibrarySettings)) { - return (WhiteboardLibrarySettings) Application.get().getJavaScriptLibrarySettings(); - } - - return null; - } - - public Map getElementMap() { - return elementMap; - } - - /** - * Give a Element object for given JSON object which represent a element - * - * @param obj - * @return - * @throws JSONException - */ - private static Element getElementObject(JSONObject obj) throws JSONException { - Element element = null; - - Type type = Type.valueOf(obj.getString("type")); - switch (type) { - case CircleGeneral: - element = new CircleGeneral(obj); - break; - case Circle_3p: - element = new Circle_3p(obj); - break; - case LineGeneral: - element = new LineGeneral(obj); - break; - case Line_2p: - element = new Line_2p(obj); - break; - case PencilArrow: - element = new PencilArrow(obj); - break; - case PencilCircle: - element = new PencilCircle(obj); - break; - case PencilCurve: - element = new PencilCurve(obj); - break; - case PencilFreeLine: - element = new PencilFreeLine(obj); - break; - case PencilPointAtRect: - element = new PencilPointAtRect(obj); - break; - case PencilPointer: - element = new PencilPointer(obj); - break; - case PencilRect: - element = new PencilRect(obj); - break; - case PencilUnderline: - element = new PencilUnderline(obj); - break; - case PointAtCircle: - element = new PointAtCircle(obj); - break; - case PointAtLine: - element = new PointAtLine(obj); - break; - case PointFree: - element = new PointFree(obj); - break; - case Point_2c: - element = new Point_2c(obj); - break; - case Point_2l: - element = new Point_2l(obj); - break; - case Point_lc: - element = new Point_lc(obj); - break; - case Segment: - element = new Segment(obj); - break; - case Text: - element = new Text(obj); - break; - case ClipArt: - element = new ClipArt(obj); - break; - default: - break; - - } - - return element; - } - - /** - * Load clipArts from the clipArt folder and filling the clipArts list - */ - private void loadClipArts() { - List pictureExtensions = Arrays.asList(new String[] { "jpg", "bmp", "png", "jpeg", "gif" }); - ServletContext servletContext = WebApplication.get().getServletContext(); - - HttpServletRequest httpReq = (HttpServletRequest) ((WebRequest) RequestCycle.get().getRequest()) - .getContainerRequest(); - Url relative = Url.parse(httpReq.getContextPath()); - String basURL = RequestCycle.get().getUrlRenderer().renderFullUrl(relative); - - String clipArtFolderPath = servletContext.getRealPath("") + "/" + clipArtFolder; - File folder = new File(clipArtFolderPath); - - for (final File fileEntry : folder.listFiles()) { - if (!fileEntry.isDirectory()) { - String extension = ""; - int i = fileEntry.getAbsolutePath().lastIndexOf('.'); - if (i > 0) { - extension = fileEntry.getAbsolutePath().substring(i + 1); - } - if (pictureExtensions.contains(extension)) { - String clipArtURL = basURL + "/" + clipArtFolder + "/" + fileEntry.getName(); - if (!clipArts.contains(clipArtURL)) { - clipArts.add(clipArtURL); - } - } - } - } - } - - /** - * Load documents from the documents folder and filling the documents list - */ - private void loadDocuments() { - String pictureExtension = "jpg"; - ServletContext servletContext = WebApplication.get().getServletContext(); - - HttpServletRequest httpReq = (HttpServletRequest) ((WebRequest) RequestCycle.get().getRequest()).getContainerRequest(); - Url relative = Url.parse(httpReq.getContextPath()); - String basURL = RequestCycle.get().getUrlRenderer().renderFullUrl(relative); - - String clipArtFolderPath = servletContext.getRealPath("") + "/" + documentFolder; - File folder = new File(clipArtFolderPath); - - for (final File fileEntry : folder.listFiles()) { - if (!fileEntry.isDirectory()) { - String extension = ""; - int i = fileEntry.getAbsolutePath().lastIndexOf('.'); - if (i > 0) { - extension = fileEntry.getAbsolutePath().substring(i + 1); - } - if (pictureExtension.equals(extension)) { - String docURL = basURL + "/" + documentFolder + "/" + fileEntry.getName(); - - String documentName = fileEntry.getName().substring(0, fileEntry.getName().lastIndexOf('.')); - - if (-1 == documentName.lastIndexOf('_')) { - ArrayList docList = new ArrayList<>(); - docList.add(docURL); - docMap.put(documentName, docList); - } else { - String documentBaseName = documentName.substring(0, documentName.lastIndexOf('_')); - if (docMap.containsKey(documentBaseName)) { - docMap.get(documentBaseName).add(docURL); - } - } - - } - } - } - } - - /** - * Check the equality of two elements on a whiteboard - * - * @param element1 - * @param element2 - * @return - */ - private static boolean isEqual(JSONObject element1, JSONObject element2) { - for (String key : element1.keySet()) { - Object value = null; - try { - value = element2.get(key); - if (value == null) { - return false; - } else { - if (value instanceof String) { - if (!value.equals(element1.get(key))) { - return false; - } - } else if (value instanceof Integer) { - Integer x = (Integer) value; - Integer y = (Integer) element1.get(key); - if (x.intValue() != y.intValue()) { - return false; - } - } else if (value instanceof Double) { - Double x = (Double) value; - Double y = (Double) element1.get(key); - if (x.doubleValue() != y.doubleValue()) { - return false; - } - } - } - } catch (JSONException e) { - log.error("Unexpected error while checking equal", e); - return false; - } - - } - return true; - } - - private static void addUndo(BlockingDeque deq, T e) { - while (!deq.offer(e)) { - deq.pop(); // TODO check if exception is possible here - } - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/WhiteboardData.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/WhiteboardData.java deleted file mode 100644 index 575424fc4d..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/WhiteboardData.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.wicketstuff.whiteboard; - -import org.wicketstuff.whiteboard.elements.Element; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.concurrent.BlockingDeque; - -/** - * This class holds all the data structures which are common to a whiteboard instance - */ -public class WhiteboardData { - - private Map elementMap; - private Map loadedElementMap; - - private BlockingDeque> undoSnapshots; - private BlockingDeque> undoSnapshotCreationList; - - private ArrayList clipArts; - private String clipArtFolder; - - private Map> docMap; - private String documentFolder; - - private Background background; - - private BlockingDeque undoSnapshots_Background; - private BlockingDeque undoSnapshotCreationList_Background; - - private BlockingDeque isElementSnapshotList; - - private String loadedContent; - - public WhiteboardData(Map elementMap, Map loadedElementMap, - BlockingDeque> undoSnapshots, BlockingDeque> undoSnapshotCreationList, - BlockingDeque undoSnapshots_Background, - BlockingDeque undoSnapshotCreationList_Background, BlockingDeque isElementSnapshotList, - ArrayList clipArts, String clipArtFolder, Map> docMap, - String documentFolder, Background background, String loadedContent) { - this.elementMap = elementMap; - this.loadedElementMap = loadedElementMap; - this.undoSnapshots = undoSnapshots; - this.undoSnapshotCreationList = undoSnapshotCreationList; - this.clipArts = clipArts; - this.clipArtFolder = clipArtFolder; - this.docMap = docMap; - this.documentFolder = documentFolder; - this.background = background; - this.loadedContent = loadedContent; - this.undoSnapshots_Background = undoSnapshots_Background; - this.undoSnapshotCreationList_Background = undoSnapshotCreationList_Background; - this.isElementSnapshotList = isElementSnapshotList; - } - - public Map getElementMap() { - return elementMap; - } - - public void setElementMap(Map elementMap) { - this.elementMap = elementMap; - } - - public Map getLoadedElementMap() { - return loadedElementMap; - } - - public void setLoadedElementMap(Map loadedElementMap) { - this.loadedElementMap = loadedElementMap; - } - - public BlockingDeque> getUndoSnapshots() { - return undoSnapshots; - } - - public void setUndoSnapshots(BlockingDeque> undoSnapshots) { - this.undoSnapshots = undoSnapshots; - } - - public BlockingDeque> getUndoSnapshotCreationList() { - return undoSnapshotCreationList; - } - - public void setUndoSnapshotCreationList(BlockingDeque> undoSnapshotCreationList) { - this.undoSnapshotCreationList = undoSnapshotCreationList; - } - - public ArrayList getClipArts() { - return clipArts; - } - - public void setClipArts(ArrayList clipArts) { - this.clipArts = clipArts; - } - - public String getClipArtFolder() { - return clipArtFolder; - } - - public void setClipArtFolder(String clipArtFolder) { - this.clipArtFolder = clipArtFolder; - } - - public Map> getDocMap() { - return docMap; - } - - public void setDocMap(Map> docMap) { - this.docMap = docMap; - } - - public String getDocumentFolder() { - return documentFolder; - } - - public void setDocumentFolder(String documentFolder) { - this.documentFolder = documentFolder; - } - - public Background getBackground() { - return background; - } - - public void setBackground(Background background) { - this.background = background; - } - - public String getLoadedContent() { - return loadedContent; - } - - public void setLoadedContent(String loadedContent) { - this.loadedContent = loadedContent; - } - - public BlockingDeque getUndoSnapshots_Background() { - return undoSnapshots_Background; - } - - public void setUndoSnapshots_Background(BlockingDeque undoSnapshots_Background) { - this.undoSnapshots_Background = undoSnapshots_Background; - } - - public BlockingDeque getUndoSnapshotCreationList_Background() { - return undoSnapshotCreationList_Background; - } - - public void setUndoSnapshotCreationList_Background(BlockingDeque undoSnapshotCreationList_Background) { - this.undoSnapshotCreationList_Background = undoSnapshotCreationList_Background; - } - - public BlockingDeque getIsElementSnapshotList() { - return isElementSnapshotList; - } - - public void setIsElementSnapshotList(BlockingDeque elementSnapshotList) { - isElementSnapshotList = elementSnapshotList; - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/CircleGeneral.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/CircleGeneral.java deleted file mode 100644 index a2ede609ce..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/CircleGeneral.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.elements; - -import com.github.openjson.JSONException; -import com.github.openjson.JSONObject; - -/** - * This class represent a line element on Whiteboard which is represented by three coordinates - * - * @author andunslg - */ -public class CircleGeneral extends Element { - private static final long serialVersionUID = 1L; - protected double a; - protected double b; - protected double c; - - public CircleGeneral(int id, String label, String color, Boolean hidden, Type type, Boolean trace, double a, - double b, double c) { - super(id, label, color, hidden, type, trace); - this.a = a; - this.b = b; - this.c = c; - } - - public CircleGeneral(JSONObject object) { - super(object); - this.type = Type.CircleGeneral; - this.a = object.getInt("a"); - this.b = object.getInt("b"); - this.c = object.getInt("c"); - - } - - /** - * Return a JSON object which represent the Element - * - * @return JSON object with field values added - * @throws JSONException - */ - @Override - public JSONObject getJSON() { - JSONObject jsonObject = super.getJSON(new JSONObject()); - jsonObject.put("a", a); - jsonObject.put("b", b); - jsonObject.put("c", c); - return jsonObject; - } - - public double getB() { - return b; - } - - public void setB(double b) { - this.b = b; - } - - public double getA() { - return a; - } - - public void setA(double a) { - this.a = a; - } - - public double getC() { - return c; - } - - public void setC(double c) { - this.c = c; - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/Circle_3p.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/Circle_3p.java deleted file mode 100644 index 35d8042232..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/Circle_3p.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.elements; - -import com.github.openjson.JSONException; -import com.github.openjson.JSONObject; - -/** - * This class rep Hold common fields for each element - * - * @author andunslg - */ -public class Circle_3p extends Element { - private static final long serialVersionUID = 1L; - protected int p1; - protected int p2; - protected int p3; - - public Circle_3p(int id, String label, String color, Boolean hidden, Type type, Boolean trace, int p1, int p2, - int p3) { - super(id, label, color, hidden, type, trace); - this.p1 = p1; - this.p2 = p2; - this.p3 = p3; - } - - public Circle_3p(JSONObject object) { - super(object); - this.type = Type.Circle_3p; - this.p1 = object.getInt("p1"); - this.p2 = object.getInt("p2"); - this.p3 = object.getInt("p3"); - } - - /** - * Return a JSON object which represent the Element - * - * @return JSON object with field values added - * @throws JSONException - */ - @Override - public JSONObject getJSON() { - JSONObject jsonObject = super.getJSON(new JSONObject()); - jsonObject.put("p1", p1); - jsonObject.put("p2", p2); - jsonObject.put("p3", p3); - return jsonObject; - } - - public int getP2() { - return p2; - } - - public void setP2(int p2) { - this.p2 = p2; - } - - public int getP1() { - return p1; - } - - public void setP1(int p1) { - this.p1 = p1; - } - - public int getP3() { - return p3; - } - - public void setP3(int p3) { - this.p3 = p3; - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/ClipArt.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/ClipArt.java deleted file mode 100644 index 1cc5478eec..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/ClipArt.java +++ /dev/null @@ -1,63 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.elements; - -import com.github.openjson.JSONException; -import com.github.openjson.JSONObject; - -/** - * This class represent a clipArt picture element on Whiteboard - * - * @author andunslg - */ -public class ClipArt extends Element { - private static final long serialVersionUID = 1L; - protected int r; // id of the rectangle object which holds the clipArt - - public ClipArt(int id, String label, String color, Boolean hidden, Type type, Boolean trace, int r) { - super(id, label, color, hidden, type, trace); - this.r = r; - } - - public ClipArt(JSONObject object) { - super(object); - this.type = Type.ClipArt; - this.r = object.getInt("r"); - } - - /** - * Return a JSON object which represent the Element - * - * @return JSON object with field values added - * @throws JSONException - */ - @Override - public JSONObject getJSON() { - JSONObject jsonObject = super.getJSON(new JSONObject()); - jsonObject.put("r", r); - - return jsonObject; - } - - public double getR() { - return r; - } - - public void setR(int r) { - this.r = r; - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/Element.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/Element.java deleted file mode 100644 index 23b0e66f27..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/Element.java +++ /dev/null @@ -1,154 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.elements; - -import java.io.Serializable; - -import com.github.openjson.JSONException; -import com.github.openjson.JSONObject; - -/** - * This class is the parent of all the geometric and textual elements in whiteboard Hold common fields for each element - * - * @author andunslg - */ -public abstract class Element implements Serializable { - private static final long serialVersionUID = 1L; - protected int id; // index of the element in the collection list - protected String label; // text label for the element - protected String color; // color of the element - protected Boolean trace; // flag if the element should left trace when moved - protected Boolean hidden; // flag if the element hidden (not visible) - protected Type type; // type (class) of the element - - public enum Type { - Circle_3p - , CircleGeneral - , Line_2p - , LineGeneral - , PencilArrow - , PencilCircle - , PencilCurve - , PencilFreeLine - , PencilPointAtRect - , PencilPointer - , PencilRect - , PencilUnderline - , Point_2c - , Point_2l - , PointAtCircle - , PointAtLine - , PointFree - , Point_lc - , Segment - , Text - , ClipArt - } - - public Element(int id, String label, String color, Boolean hidden, Type type, Boolean trace) { - this.id = id; - this.label = label; - this.color = color; - this.hidden = hidden; - this.type = type; - this.trace = trace; - } - - public Element(JSONObject object) { - this.id = object.optInt("id"); - this.label = object.optString("label"); - this.color = object.optString("color"); - this.trace = object.optBoolean("trace"); - this.hidden = object.optBoolean("hidden"); - } - - public abstract JSONObject getJSON(); - - /** - * Return a JSON object which represent the Element - * - * @param obj - * JSON object which will will be used to add field values - * @return JSON object with field values added - * @throws JSONException - */ - public JSONObject getJSON(JSONObject obj) { - obj.put("id", id); - obj.put("type", type); - if (label != null) { - obj.put("label", label); - } - if (color != null) { - obj.put("color", color); - } - if (hidden != null) { - obj.put("hidden", hidden); - } - if (trace != null) { - obj.put("trace", trace); - } - return obj; - } - - public int getId() { - return id; - } - - public void setId(int id) { - this.id = id; - } - - public String getLabel() { - return label; - } - - public void setLabel(String label) { - this.label = label; - } - - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - public Boolean isTrace() { - return trace; - } - - public void setTrace(Boolean trace) { - this.trace = trace; - } - - public Boolean isHidden() { - return hidden; - } - - public void setHidden(Boolean hidden) { - this.hidden = hidden; - } - - public Type getType() { - return type; - } - - public void setType(Type type) { - this.type = type; - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/LineGeneral.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/LineGeneral.java deleted file mode 100644 index 3def509996..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/LineGeneral.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.elements; - -import com.github.openjson.JSONException; -import com.github.openjson.JSONObject; - -/** - * This class represent a line element on Whiteboard which is represented by three coordinates - * - * @author andunslg - */ -public class LineGeneral extends Element { - private static final long serialVersionUID = 1L; - protected double a; - protected double b; - protected double c; - - public LineGeneral(int id, String label, String color, Boolean hidden, Type type, Boolean trace, double a, - double b, double c) { - super(id, label, color, hidden, type, trace); - this.a = a; - this.b = b; - this.c = c; - } - - public LineGeneral(JSONObject object) { - super(object); - this.type = Type.LineGeneral; - this.a = object.getInt("a"); - this.b = object.getInt("b"); - this.c = object.getInt("c"); - } - - /** - * Return a JSON object which represent the Element - * - * @return JSON object with field values added - * @throws JSONException - */ - @Override - public JSONObject getJSON() { - JSONObject jsonObject = super.getJSON(new JSONObject()); - jsonObject.put("a", a); - jsonObject.put("b", b); - jsonObject.put("c", c); - return jsonObject; - } - - public double getB() { - return b; - } - - public void setB(double b) { - this.b = b; - } - - public double getA() { - return a; - } - - public void setA(double a) { - this.a = a; - } - - public double getC() { - return c; - } - - public void setC(double c) { - this.c = c; - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/Line_2p.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/Line_2p.java deleted file mode 100644 index 2007d53d27..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/Line_2p.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.elements; - -import com.github.openjson.JSONException; -import com.github.openjson.JSONObject; - -/** - * This class represent a line element on Whiteboard which is represented by two coordinates - * - * @author andunslg - */ -public class Line_2p extends Element { - private static final long serialVersionUID = 1L; - protected int p1; - protected int p2; - - public Line_2p(int id, String label, String color, Boolean hidden, Type type, Boolean trace, int p1, int p2) { - super(id, label, color, hidden, type, trace); - this.p1 = p1; - this.p2 = p2; - } - - public Line_2p(JSONObject object) { - super(object); - this.type = Type.Line_2p; - this.p1 = object.getInt("p1"); - this.p2 = object.getInt("p2"); - - } - - /** - * Return a JSON object which represent the Element - * - * @return JSON object with field values added - * @throws JSONException - */ - @Override - public JSONObject getJSON() { - JSONObject jsonObject = super.getJSON(new JSONObject()); - jsonObject.put("p1", p1); - jsonObject.put("p2", p2); - return jsonObject; - } - - public int getP2() { - return p2; - } - - public void setP2(int p2) { - this.p2 = p2; - } - - public int getP1() { - return p1; - } - - public void setP1(int p1) { - this.p1 = p1; - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PencilArrow.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PencilArrow.java deleted file mode 100644 index f626e83a3e..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PencilArrow.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.elements; - -import com.github.openjson.JSONException; -import com.github.openjson.JSONObject; - -/** - * This class represent a arrow element on Whiteboard which is represented by starting point of the arrow , ending point - * of the arrow nad the thickness of the arrow. - * - * @author andunslg - */ -public class PencilArrow extends Element { - private static final long serialVersionUID = 1L; - protected int p1; - protected int p2; - protected int thick; - - public PencilArrow(int id, String label, String color, Boolean hidden, Type type, Boolean trace, int p1, int p2, - int thick) { - super(id, label, color, hidden, type, trace); - this.p1 = p1; - this.p2 = p2; - this.thick = thick; - } - - public PencilArrow(JSONObject object) { - super(object); - this.type = Type.PencilArrow; - this.p1 = object.getInt("p1"); - this.p2 = object.getInt("p2"); - this.thick = object.getInt("thick"); - } - - /** - * Return a JSON object which represent the Element - * - * @return JSON object with field values added - * @throws JSONException - */ - @Override - public JSONObject getJSON() { - JSONObject jsonObject = super.getJSON(new JSONObject()); - jsonObject.put("p1", p1); - jsonObject.put("p2", p2); - jsonObject.put("thick", thick); - return jsonObject; - } - - public int getP2() { - return p2; - } - - public void setP2(int p2) { - this.p2 = p2; - } - - public int getP1() { - return p1; - } - - public void setP1(int p1) { - this.p1 = p1; - } - - public int getThick() { - return thick; - } - - public void setThick(int thick) { - this.thick = thick; - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PencilCircle.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PencilCircle.java deleted file mode 100644 index 01ca1579c6..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PencilCircle.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.elements; - -import com.github.openjson.JSONException; -import com.github.openjson.JSONObject; - -/** - * This class represent a circle element on Whiteboard which is represented by center coordinate and a coordinate on - * circumference - * - * @author andunslg - */ -public class PencilCircle extends Element { - private static final long serialVersionUID = 1L; - protected int p1; - protected int p2; - - public PencilCircle(int id, String label, String color, Boolean hidden, Type type, Boolean trace, int p1, int p2) { - super(id, label, color, hidden, type, trace); - this.p1 = p1; - this.p2 = p2; - } - - public PencilCircle(JSONObject object) { - super(object); - this.type = Type.PencilCircle; - this.p1 = object.getInt("p1"); - this.p2 = object.getInt("p2"); - } - - /** - * Return a JSON object which represent the Element - * - * @return JSON object with field values added - * @throws JSONException - */ - @Override - public JSONObject getJSON() { - JSONObject jsonObject = super.getJSON(new JSONObject()); - jsonObject.put("p1", p1); - jsonObject.put("p2", p2); - return jsonObject; - } - - public int getP2() { - return p2; - } - - public void setP2(int p2) { - this.p2 = p2; - } - - public int getP1() { - return p1; - } - - public void setP1(int p1) { - this.p1 = p1; - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PencilCurve.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PencilCurve.java deleted file mode 100644 index 8338e70d5a..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PencilCurve.java +++ /dev/null @@ -1,106 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.elements; - -import java.util.ArrayList; -import java.util.List; - -import com.github.openjson.JSONException; -import com.github.openjson.JSONObject; - -/** - * This class represent a curve element on Whiteboard which is represented by list of coordinate points - * - * @author andunslg - */ -public class PencilCurve extends Element { - private static final long serialVersionUID = 1L; - protected int p0; - protected List points; - - public PencilCurve(int id, String label, String color, Boolean hidden, Type type, Boolean trace, int p0, - List points) { - super(id, label, color, hidden, type, trace); - this.p0 = p0; - this.points = points; - } - - public PencilCurve(JSONObject object) { - super(object); - this.type = Type.PencilCurve; - this.p0 = object.getInt("p0"); - - int pointCount = 0; - - while (true) { - try { - object.get("x" + pointCount); - pointCount++; - } catch (JSONException e) { - break; - } - } - - this.points = new ArrayList<>(); - - for (int i = 0; i < pointCount; i++) { - if (object.get("x" + i) instanceof Double) { - Double[][] point = { { object.getDouble("x" + i), object.getDouble("y" + i) } }; - points.add(point); - } else { - double x = object.getInt("x" + i); - double y = object.getInt("y" + i); - Double[][] point = { { x, y } }; - points.add(point); - } - } - } - - /** - * Return a JSON object which represent the Element - * - * @return JSON object with field values added - * @throws JSONException - */ - @Override - public JSONObject getJSON() { - JSONObject jsonObject = super.getJSON(new JSONObject()); - jsonObject.put("p0", p0); - for (int i = 0; i < points.size(); i++) { - jsonObject.put("x" + i, points.get(i)[0][0]); - jsonObject.put("y" + i, points.get(i)[0][1]); - } - - return jsonObject; - } - - public List getPoints() { - return points; - } - - public void setPoints(List points) { - this.points = points; - } - - public int getP0() { - return p0; - } - - public void setP0(int p0) { - this.p0 = p0; - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PencilFreeLine.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PencilFreeLine.java deleted file mode 100644 index c762857b64..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PencilFreeLine.java +++ /dev/null @@ -1,77 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.elements; - -import com.github.openjson.JSONException; -import com.github.openjson.JSONObject; - -/** - * This class represent a line element on Whiteboard which is represented by two coordinate and drawn using pencil tool - * on whiteboard - * - * @author andunslg - */ -public class PencilFreeLine extends Element { - private static final long serialVersionUID = 1L; - protected int p1; - protected int p2; - - public PencilFreeLine(int id, String label, String color, Boolean hidden, Type type, Boolean trace, int p1, int p2) { - super(id, label, color, hidden, type, trace); - this.p1 = p1; - this.p2 = p2; - } - - public PencilFreeLine(JSONObject object) { - super(object); - this.type = Type.PencilFreeLine; - this.p1 = object.getInt("p1"); - this.p2 = object.getInt("p2"); - - } - - /** - * Return a JSON object which represent the Element - * - * @return JSON object with field values added - * @throws JSONException - */ - @Override - public JSONObject getJSON() { - JSONObject jsonObject = super.getJSON(new JSONObject()); - jsonObject.put("p1", p1); - jsonObject.put("p2", p2); - - return jsonObject; - } - - public int getP2() { - return p2; - } - - public void setP2(int p2) { - this.p2 = p2; - } - - public int getP1() { - return p1; - } - - public void setP1(int p1) { - this.p1 = p1; - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PencilPointAtRect.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PencilPointAtRect.java deleted file mode 100644 index 4a74f8846d..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PencilPointAtRect.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.elements; - -import com.github.openjson.JSONException; -import com.github.openjson.JSONObject; - -/** - * This class represent a point element on Whiteboard which is on a rectangle - * - * @author andunslg - */ -public class PencilPointAtRect extends Element { - private static final long serialVersionUID = 1L; - protected int obj; - protected String s; - protected double t; - - public PencilPointAtRect(int id, String label, String color, Boolean hidden, Type type, Boolean trace, String s, - double t, int obj) { - super(id, label, color, hidden, type, trace); - this.s = s; - this.t = t; - this.obj = obj; - } - - public PencilPointAtRect(JSONObject object) { - super(object); - this.type = Type.PencilPointAtRect; - this.obj = object.getInt("obj"); - this.s = object.getString("s"); - this.t = object.getDouble("t"); - } - - /** - * Return a JSON object which represent the Element - * - * @return JSON object with field values added - * @throws JSONException - */ - @Override - public JSONObject getJSON() { - JSONObject jsonObject = super.getJSON(new JSONObject()); - jsonObject.put("obj", obj); - jsonObject.put("s", s); - jsonObject.put("t", t); - - return jsonObject; - } - - public int getObj() { - return obj; - } - - public void setObj(int obj) { - this.obj = obj; - } - - public String getS() { - return s; - } - - public void setS(String s) { - this.s = s; - } - - public double getT() { - return t; - } - - public void setT(double t) { - this.t = t; - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PencilPointer.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PencilPointer.java deleted file mode 100644 index 14a5f6906b..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PencilPointer.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.elements; - -import com.github.openjson.JSONException; -import com.github.openjson.JSONObject; - -/** - * This class represent a pointer element on Whiteboard which is represented by a coordinate and a blinking time - * - * @author andunslg - */ -public class PencilPointer extends Element { - private static final long serialVersionUID = 1L; - protected int p; - protected int age; - - public PencilPointer(int id, String label, String color, Boolean hidden, Type type, Boolean trace, int p, int age) { - super(id, label, color, hidden, type, trace); - this.p = p; - this.age = age; - } - - public PencilPointer(JSONObject object) { - super(object); - this.type = Type.PencilPointer; - this.p = object.getInt("p"); - this.age = "undefined".equals(object.get("age")) ? 1000 : object.getInt("age"); - } - - /** - * Return a JSON object which represent the Element - * - * @return JSON object with field values added - * @throws JSONException - */ - @Override - public JSONObject getJSON() { - JSONObject jsonObject = super.getJSON(new JSONObject()); - jsonObject.put("p", p); - jsonObject.put("age", age); - - return jsonObject; - } - - public int getP() { - return p; - } - - public void setP(int p) { - this.p = p; - } - - public int getAge() { - return age; - } - - public void setAge(int age) { - this.age = age; - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PencilRect.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PencilRect.java deleted file mode 100644 index 63ee27ff14..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PencilRect.java +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.elements; - -import com.github.openjson.JSONException; -import com.github.openjson.JSONObject; - -/** - * This class represent a rectangle element on Whiteboard which is represented by two vertices point on a diagonal - * - * @author andunslg - */ -public class PencilRect extends Element { - private static final long serialVersionUID = 1L; - protected int p1; - protected int p2; - - public PencilRect(int id, String label, String color, Boolean hidden, Type type, Boolean trace, int p1, int p2) { - super(id, label, color, hidden, type, trace); - this.p1 = p1; - this.p2 = p2; - } - - public PencilRect(JSONObject object) { - super(object); - this.type = Type.PencilRect; - this.p1 = object.getInt("p1"); - this.p2 = object.getInt("p2"); - - } - - /** - * Return a JSON object which represent the Element - * - * @return JSON object with field values added - * @throws JSONException - */ - @Override - public JSONObject getJSON() { - JSONObject jsonObject = super.getJSON(new JSONObject()); - jsonObject.put("p1", p1); - jsonObject.put("p2", p2); - - return jsonObject; - } - - public int getP2() { - return p2; - } - - public void setP2(int p2) { - this.p2 = p2; - } - - public int getP1() { - return p1; - } - - public void setP1(int p1) { - this.p1 = p1; - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PencilUnderline.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PencilUnderline.java deleted file mode 100644 index 949f816780..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PencilUnderline.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.elements; - -import com.github.openjson.JSONException; -import com.github.openjson.JSONObject; - -/** - * This class represent a underline element on Whiteboard which is represented by starting point of the underline , - * ending point of the underline nad the thickness of the underline. - * - * @author andunslg - */ -public class PencilUnderline extends Element { - private static final long serialVersionUID = 1L; - protected int p1; - protected int p2; - protected int thick; - - public PencilUnderline(int id, String label, String color, Boolean hidden, Type type, Boolean trace, int p1, - int p2, int thick) { - super(id, label, color, hidden, type, trace); - this.p1 = p1; - this.p2 = p2; - this.thick = thick; - } - - public PencilUnderline(JSONObject object) { - super(object); - this.type = Type.PencilUnderline; - this.p1 = object.getInt("p1"); - this.p2 = object.getInt("p2"); - this.thick = object.getInt("thick"); - } - - /** - * Return a JSON object which represent the Element - * - * @return JSON object with field values added - * @throws JSONException - */ - @Override - public JSONObject getJSON() { - JSONObject jsonObject = super.getJSON(new JSONObject()); - jsonObject.put("p1", p1); - jsonObject.put("p2", p2); - jsonObject.put("thick", thick); - - return jsonObject; - } - - public int getP2() { - return p2; - } - - public void setP2(int p2) { - this.p2 = p2; - } - - public int getP1() { - return p1; - } - - public void setP1(int p1) { - this.p1 = p1; - } - - public int getThick() { - return thick; - } - - public void setThick(int thick) { - this.thick = thick; - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PointAtCircle.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PointAtCircle.java deleted file mode 100644 index 3753b62ba1..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PointAtCircle.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.elements; - -import com.github.openjson.JSONException; -import com.github.openjson.JSONObject; - -/** - * This class represent a point element on Whiteboard which is on a circle element - * - * @author andunslg - */ -public class PointAtCircle extends Element { - private static final long serialVersionUID = 1L; - protected int obj; - protected double x; - protected double y; - - public PointAtCircle(int id, String label, String color, Boolean hidden, Type type, Boolean trace, double x, - double y, int obj) { - super(id, label, color, hidden, type, trace); - this.x = x; - this.y = y; - this.obj = obj; - } - - public PointAtCircle(JSONObject object) { - super(object); - this.type = Type.PointAtCircle; - this.obj = object.getInt("obj"); - this.x = object.getDouble("x"); - this.y = object.getDouble("y"); - } - - /** - * Return a JSON object which represent the Element - * - * @return JSON object with field values added - * @throws JSONException - */ - @Override - public JSONObject getJSON() { - JSONObject jsonObject = super.getJSON(new JSONObject()); - jsonObject.put("obj", obj); - jsonObject.put("x", x); - jsonObject.put("y", y); - - return jsonObject; - } - - public int getObj() { - return obj; - } - - public void setObj(int obj) { - this.obj = obj; - } - - public double getX() { - return x; - } - - public void setT(double x) { - this.x = x; - } - - public double getY() { - return y; - } - - public void setY(double x) { - this.x = x; - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PointAtLine.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PointAtLine.java deleted file mode 100644 index f59e910010..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PointAtLine.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.elements; - -import com.github.openjson.JSONException; -import com.github.openjson.JSONObject; - -/** - * This class represent a point element on Whiteboard which is on a line element - * - * @author andunslg - */ -public class PointAtLine extends Element { - private static final long serialVersionUID = 1L; - protected int obj; - protected double t; - - public PointAtLine(int id, String label, String color, Boolean hidden, Type type, Boolean trace, double t, int obj) { - super(id, label, color, hidden, type, trace); - this.t = t; - this.obj = obj; - } - - public PointAtLine(JSONObject object) { - super(object); - this.type = Type.PointAtLine; - this.obj = object.getInt("obj"); - this.t = object.getDouble("t"); - } - - /** - * Return a JSON object which represent the Element - * - * @return JSON object with field values added - * @throws JSONException - */ - @Override - public JSONObject getJSON() { - JSONObject jsonObject = super.getJSON(new JSONObject()); - jsonObject.put("obj", obj); - jsonObject.put("t", t); - - return jsonObject; - } - - public int getObj() { - return obj; - } - - public void setObj(int obj) { - this.obj = obj; - } - - public double getT() { - return t; - } - - public void setT(double t) { - this.t = t; - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PointFree.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PointFree.java deleted file mode 100644 index 8dcd081c82..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/PointFree.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.elements; - -import com.github.openjson.JSONException; -import com.github.openjson.JSONObject; - -/** - * This class represent a point element on Whiteboard - * - * @author andunslg - */ -public class PointFree extends Element { - private static final long serialVersionUID = 1L; - protected double x; // x coordinate of the point - protected double y; // y coordinate of the point - - public PointFree(int id, String label, String color, Boolean hidden, Type type, Boolean trace, double x, double y) { - super(id, label, color, hidden, type, trace); - this.x = x; - this.y = y; - } - - public PointFree(JSONObject object) { - super(object); - this.type = Type.PointFree; - this.x = object.get("x") instanceof Double ? object.getDouble("x") : object.getInt("x"); - this.y = object.get("y") instanceof Double ? object.getDouble("y") : object.getInt("y"); - } - - /** - * Return a JSON object which represent the Element - * - * @return JSON object with field values added - * @throws JSONException - */ - @Override - public JSONObject getJSON() { - JSONObject jsonObject = super.getJSON(new JSONObject()); - jsonObject.put("x", x); - jsonObject.put("y", y); - - return jsonObject; - } - - public double getX() { - return x; - } - - public void setX(double x) { - this.x = x; - } - - public double getY() { - return y; - } - - public void setY(double y) { - this.y = y; - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/Point_2c.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/Point_2c.java deleted file mode 100644 index e4d8ee6390..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/Point_2c.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.elements; - -import com.github.openjson.JSONException; -import com.github.openjson.JSONObject; - -/** - * This class represent a point element on Whiteboard - * - * @author andunslg - */ -public class Point_2c extends Element { - private static final long serialVersionUID = 1L; - protected int obj1; - protected int obj2; - protected int num; - - public Point_2c(int id, String label, String color, Boolean hidden, Type type, Boolean trace, int obj1, int obj2, - int num) { - super(id, label, color, hidden, type, trace); - this.obj1 = obj1; - this.obj2 = obj2; - this.num = num; - } - - public Point_2c(JSONObject object) { - super(object); - this.type = Type.Point_2c; - this.obj1 = object.getInt("a"); - this.obj2 = object.getInt("b"); - this.num = object.getInt("c"); - } - - /** - * Return a JSON object which represent the Element - * - * @return JSON object with field values added - * @throws JSONException - */ - @Override - public JSONObject getJSON() { - JSONObject jsonObject = super.getJSON(new JSONObject()); - jsonObject.put("obj1", obj1); - jsonObject.put("obj2", obj2); - jsonObject.put("num", num); - - return jsonObject; - } - - public int getObj2() { - return obj2; - } - - public void setObj2(int obj2) { - this.obj2 = obj2; - } - - public int getObj1() { - return obj1; - } - - public void setObj1(int obj1) { - this.obj1 = obj1; - } - - public int getNum() { - return num; - } - - public void setNum(int num) { - this.num = num; - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/Point_2l.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/Point_2l.java deleted file mode 100644 index 0b1dd92006..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/Point_2l.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.elements; - -import com.github.openjson.JSONException; -import com.github.openjson.JSONObject; - -/** - * This class represent a point element on Whiteboard - * - * @author andunslg - */ -public class Point_2l extends Element { - private static final long serialVersionUID = 1L; - protected int obj1; - protected int obj2; - - public Point_2l(int id, String label, String color, Boolean hidden, Type type, Boolean trace, int obj1, int obj2) { - super(id, label, color, hidden, type, trace); - this.obj1 = obj1; - this.obj2 = obj2; - } - - public Point_2l(JSONObject object) { - super(object); - this.type = Type.Point_2l; - this.obj1 = object.getInt("obj1"); - this.obj2 = object.getInt("obj2"); - } - - /** - * Return a JSON object which represent the Element - * - * @return JSON object with field values added - * @throws JSONException - */ - @Override - public JSONObject getJSON() { - JSONObject jsonObject = super.getJSON(new JSONObject()); - jsonObject.put("obj1", obj1); - jsonObject.put("obj2", obj2); - - return jsonObject; - } - - public int getObj2() { - return obj2; - } - - public void setObj2(int obj2) { - this.obj2 = obj2; - } - - public int setObj1() { - return obj1; - } - - public void setObj1(int obj1) { - this.obj1 = obj1; - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/Point_lc.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/Point_lc.java deleted file mode 100644 index d6b51282e8..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/Point_lc.java +++ /dev/null @@ -1,88 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.elements; - -import com.github.openjson.JSONException; -import com.github.openjson.JSONObject; - -/** - * This class represent a point element on Whiteboard - * - * @author andunslg - */ -public class Point_lc extends Element { - private static final long serialVersionUID = 1L; - protected int obj1; - protected int obj2; - protected int num; - - public Point_lc(int id, String label, String color, Boolean hidden, Type type, Boolean trace, int obj1, int obj2, - int num) { - super(id, label, color, hidden, type, trace); - this.obj1 = obj1; - this.obj2 = obj2; - this.num = num; - } - - public Point_lc(JSONObject object) { - super(object); - this.type = Type.Point_lc; - this.obj1 = object.getInt("obj1"); - this.obj2 = object.getInt("obj2"); - this.num = object.getInt("num"); - } - - /** - * Return a JSON object which represent the Element - * - * @return JSON object with field values added - * @throws JSONException - */ - @Override - public JSONObject getJSON() { - JSONObject jsonObject = super.getJSON(new JSONObject()); - jsonObject.put("obj1", obj1); - jsonObject.put("obj2", obj2); - jsonObject.put("num", num); - - return jsonObject; - } - - public int getObj2() { - return obj2; - } - - public void setObj2(int obj2) { - this.obj2 = obj2; - } - - public int getObj1() { - return obj1; - } - - public void setObj1(int obj1) { - this.obj1 = obj1; - } - - public int getNum() { - return num; - } - - public void setNum(int num) { - this.num = num; - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/Segment.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/Segment.java deleted file mode 100644 index 6354b5e6a9..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/Segment.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.elements; - -import com.github.openjson.JSONException; -import com.github.openjson.JSONObject; - -/** - * This class represent a line segment element on Whiteboard - * - * @author andunslg - */ -public class Segment extends Element { - private static final long serialVersionUID = 1L; - protected int p1; - protected int p2; - - public Segment(int id, String label, String color, Boolean hidden, Type type, Boolean trace, int p1, int p2) { - super(id, label, color, hidden, type, trace); - this.p1 = p1; - this.p2 = p2; - } - - public Segment(JSONObject object) { - super(object); - this.type = Type.Segment; - this.p1 = object.getInt("p1"); - this.p2 = object.getInt("p2"); - } - - /** - * Return a JSON object which represent the Element - * - * @return JSON object with field values added - * @throws JSONException - */ - @Override - public JSONObject getJSON() { - JSONObject jsonObject = super.getJSON(new JSONObject()); - jsonObject.put("p1", p1); - jsonObject.put("p2", p2); - - return jsonObject; - } - - public int getP2() { - return p2; - } - - public void setP2(int p2) { - this.p2 = p2; - } - - public int getP1() { - return p1; - } - - public void setP1(int p1) { - this.p1 = p1; - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/Text.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/Text.java deleted file mode 100644 index 1ed52aca46..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/elements/Text.java +++ /dev/null @@ -1,64 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.elements; - -import com.github.openjson.JSONException; -import com.github.openjson.JSONObject; - -/** - * This class represent a text element on Whiteboard - * - * @author andunslg - */ -public class Text extends Element { - private static final long serialVersionUID = 1L; - protected int r; - - public Text(int id, String label, String color, Boolean hidden, Type type, Boolean trace, int r) { - super(id, label, color, hidden, type, trace); - this.r = r; - } - - public Text(JSONObject object) { - super(object); - this.type = Type.Text; - this.r = object.getInt("r"); - } - - /** - * Return a JSON object which represent the Element - * - * @return JSON object with field values added - * @throws JSONException - */ - @Override - public JSONObject getJSON() { - JSONObject jsonObject = super.getJSON(new JSONObject()); - jsonObject.put("r", r); - - return jsonObject; - - } - - public int getR() { - return r; - } - - public void setR(int r) { - this.r = r; - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/resource/GoogStyleSheetResourceReference.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/resource/GoogStyleSheetResourceReference.java deleted file mode 100644 index 29b4271a55..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/resource/GoogStyleSheetResourceReference.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.resource; - -import org.apache.wicket.request.resource.CssResourceReference; - -/** - * Reference Class for goog.css of Google Closure Library - * - * @author andunslg - */ -public class GoogStyleSheetResourceReference extends CssResourceReference { - private static final long serialVersionUID = 1L; - - private static final GoogStyleSheetResourceReference INSTANCE = new GoogStyleSheetResourceReference(); - - public static GoogStyleSheetResourceReference get() { - return INSTANCE; - } - - private GoogStyleSheetResourceReference() { - super(GoogStyleSheetResourceReference.class, "goog.css"); - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/resource/TranslateJavaScriptResourceReference.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/resource/TranslateJavaScriptResourceReference.java deleted file mode 100644 index 48ed2d2eab..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/resource/TranslateJavaScriptResourceReference.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.resource; - -import org.apache.wicket.request.resource.JavaScriptResourceReference; - -/** - * Reference Class for whiteboard.js which handles all the client side whiteboard manipulations - * - * @author andunslg - */ -public class TranslateJavaScriptResourceReference extends JavaScriptResourceReference { - private static final long serialVersionUID = 1L; - - private static final TranslateJavaScriptResourceReference INSTANCE = new TranslateJavaScriptResourceReference(); - - public static TranslateJavaScriptResourceReference get() { - return INSTANCE; - } - - private TranslateJavaScriptResourceReference() { - super(TranslateJavaScriptResourceReference.class, "translate.js"); - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/resource/WhiteboardHelperJavaScriptResourceReference.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/resource/WhiteboardHelperJavaScriptResourceReference.java deleted file mode 100644 index 774c504058..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/resource/WhiteboardHelperJavaScriptResourceReference.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.resource; - -import org.apache.wicket.request.resource.JavaScriptResourceReference; - -/** - * Reference Class for whiteboard.js which handles all the client side whiteboard manipulations - * - * @author andunslg - */ -public class WhiteboardHelperJavaScriptResourceReference extends JavaScriptResourceReference { - private static final long serialVersionUID = 1L; - - private static final WhiteboardHelperJavaScriptResourceReference INSTANCE = new WhiteboardHelperJavaScriptResourceReference(); - - public static WhiteboardHelperJavaScriptResourceReference get() { - return INSTANCE; - } - - private WhiteboardHelperJavaScriptResourceReference() { - super(WhiteboardHelperJavaScriptResourceReference.class, "wb-helper.js"); - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/resource/WhiteboardJavaScriptResourceReference.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/resource/WhiteboardJavaScriptResourceReference.java deleted file mode 100644 index 91278ff9d4..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/resource/WhiteboardJavaScriptResourceReference.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.resource; - -import org.apache.wicket.request.resource.JavaScriptResourceReference; - -/** - * Reference Class for whiteboard.js which handles all the client side whiteboard manipulations - * - * @author andunslg - */ -public class WhiteboardJavaScriptResourceReference extends JavaScriptResourceReference { - private static final long serialVersionUID = 1L; - - private static final WhiteboardJavaScriptResourceReference INSTANCE = new WhiteboardJavaScriptResourceReference(); - - public static WhiteboardJavaScriptResourceReference get() { - return INSTANCE; - } - - private WhiteboardJavaScriptResourceReference() { - super(WhiteboardJavaScriptResourceReference.class, "whiteboard.js"); - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/resource/WhiteboardStyleSheetResourceReference.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/resource/WhiteboardStyleSheetResourceReference.java deleted file mode 100644 index 7a973900da..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/resource/WhiteboardStyleSheetResourceReference.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.resource; - -import org.apache.wicket.request.resource.CssResourceReference; - -/** - * Reference Class for whiteboard.css which gives the stylesheet for whiteboard - * - * @author andunslg - */ -public class WhiteboardStyleSheetResourceReference extends CssResourceReference { - private static final long serialVersionUID = 1L; - - private static final WhiteboardStyleSheetResourceReference INSTANCE = new WhiteboardStyleSheetResourceReference(); - - public static WhiteboardStyleSheetResourceReference get() { - return INSTANCE; - } - - private WhiteboardStyleSheetResourceReference() { - super(WhiteboardStyleSheetResourceReference.class, "whiteboard.css"); - } -} diff --git a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/settings/WhiteboardLibrarySettings.java b/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/settings/WhiteboardLibrarySettings.java deleted file mode 100644 index d644a1f344..0000000000 --- a/whiteboard-parent/whiteboard/src/main/java/org/wicketstuff/whiteboard/settings/WhiteboardLibrarySettings.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.wicketstuff.whiteboard.settings; - -import org.apache.wicket.request.resource.CssResourceReference; -import org.apache.wicket.request.resource.JavaScriptResourceReference; -import org.apache.wicket.settings.JavaScriptLibrarySettings; - -/** - * Holds the mandatory resource references for whiteboard - * Default resources can be found in org.wicketstuff.whiteboard.resource - * @author andunslg - */ -public abstract class WhiteboardLibrarySettings extends JavaScriptLibrarySettings { - - public abstract CssResourceReference getWhiteboardStyleSheetReference(); - - public abstract CssResourceReference getGoogStyleSheetReference(); - - public abstract JavaScriptResourceReference getWhiteboardJavaScriptReference(); - - public abstract JavaScriptResourceReference getWhiteboardHelperJavaScriptReference(); - - public abstract JavaScriptResourceReference getTranslateJavaScriptReference(); - - public abstract JavaScriptResourceReference getBaseJavaScriptReference(); -} - diff --git a/whiteboard-parent/whiteboard/src/main/resources/log4j.properties b/whiteboard-parent/whiteboard/src/main/resources/log4j.properties deleted file mode 100644 index 30899af5e8..0000000000 --- a/whiteboard-parent/whiteboard/src/main/resources/log4j.properties +++ /dev/null @@ -1,2 +0,0 @@ -# Root logger option -log4j.rootLogger=DEBUG,INFO \ No newline at end of file diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/goog.css b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/goog.css deleted file mode 100644 index 2807052b36..0000000000 --- a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/goog.css +++ /dev/null @@ -1,461 +0,0 @@ -/* ************************* goog dialog.css *********************** */ -.modal-dialog { - background: #c1d9ff; - border: 1px solid #3a5774; - color: #000; - padding: 4px; - position: absolute; - border-radius: 8px; -} - -.modal-dialog-bg { - background: #666; - left: 0; - position: absolute; - top: 0; -} - -.modal-dialog-title { - background: #e0edfe; - color: #000; - cursor: pointer; - font-size: 120%; - font-weight: bold; - - /* Add padding on the right to ensure the close button has room. */ - padding: 8px 31px 8px 8px; - - position: relative; - _zoom: 1; /* Ensures proper width in IE6 RTL. */ -} - -.modal-dialog-buttons, -.modal-dialog-content { - background-color: #fff; - padding: 8px; -} - -.goog-buttonset-default { - font-weight: bold; -} - -/* **************************** Goog menu.css ************************* */ -.goog-menu { - background: #fff; - border-color: #ccc #666 #666 #ccc; - border-style: solid; - border-width: 1px; - cursor: default; - font: normal 13px Arial, sans-serif; - margin: 0; - outline: none; - padding: 4px 0; - position: absolute; - z-index: 20000; /* Arbitrary, but some apps depend on it... */ -} - -/* *************************** Goog menuitem.css *************************** */ -.goog-menuitem { - color: #000; - font: normal 13px Arial, sans-serif; - list-style: none; - margin: 0; - /* 28px on the left for icon or checkbox; 7em on the right for shortcut. */ - padding: 4px 7em 4px 28px; - white-space: nowrap; -} - -/* BiDi override for the resting state. */ -/* @noflip */ -.goog-menuitem.goog-menuitem-rtl { - /* Flip left/right padding for BiDi. */ - padding-left: 7em; - padding-right: 28px; -} - -/* If a menu doesn't have checkable items or items with icons, remove padding. */ -.goog-menu-nocheckbox .goog-menuitem, -.goog-menu-noicon .goog-menuitem { - padding-left: 12px; -} - -/* - * If a menu doesn't have items with shortcuts, leave just enough room for - * submenu arrows, if they are rendered. - */ -.goog-menu-noaccel .goog-menuitem { - padding-right: 20px; -} - -.goog-menuitem-content { - color: #000; - font: normal 13px Arial, sans-serif; -} - -/* State: disabled. */ -.goog-menuitem-disabled .goog-menuitem-accel, -.goog-menuitem-disabled .goog-menuitem-content { - color: #ccc !important; -} - -.goog-menuitem-disabled .goog-menuitem-icon { - opacity: 0.3; - -moz-opacity: 0.3; - filter: alpha(opacity = 30); -} - -/* State: hover. */ -.goog-menuitem-highlight, -.goog-menuitem-hover { - background-color: #d6e9f8; - /* Use an explicit top and bottom border so that the selection is visible - * in high contrast mode. */ - border-color: #d6e9f8; - border-style: dotted; - border-width: 1px 0; - padding-bottom: 3px; - padding-top: 3px; -} - -/* State: selected/checked. */ -.goog-menuitem-checkbox, -.goog-menuitem-icon { - background-repeat: no-repeat; - height: 16px; - left: 6px; - position: absolute; - right: auto; - vertical-align: middle; - width: 16px; -} - -/* BiDi override for the selected/checked state. */ -/* @noflip */ -.goog-menuitem-rtl .goog-menuitem-checkbox, -.goog-menuitem-rtl .goog-menuitem-icon { - /* Flip left/right positioning. */ - left: auto; - right: 6px; -} - -.goog-option-selected .goog-menuitem-checkbox, -.goog-option-selected .goog-menuitem-icon { - /* Client apps may override the URL at which they serve the sprite. */ - background: url(image/editortoolbar.png) no-repeat -512px 0; -} - -/* Keyboard shortcut ("accelerator") style. */ -.goog-menuitem-accel { - color: #999; - /* Keyboard shortcuts are untranslated; always left-to-right. */ - /* @noflip */ - direction: ltr; - left: auto; - padding: 0 6px; - position: absolute; - right: 0; - text-align: right; -} - -/* BiDi override for shortcut style. */ -/* @noflip */ -.goog-menuitem-rtl .goog-menuitem-accel { - /* Flip left/right positioning and text alignment. */ - left: 0; - right: auto; - text-align: left; -} - -/* Mnemonic styles. */ -.goog-menuitem-mnemonic-hint { - text-decoration: underline; -} - -.goog-menuitem-mnemonic-separator { - color: #999; - font-size: 12px; - padding-left: 4px; -} - -/* ************************* goog menubutton.css *********************** */ -/* State: resting. */ -.goog-menu-button { - /* Client apps may override the URL at which they serve the image. */ - background: #ddd url(image/button-bg.gif) repeat-x top left; - border: 0; - color: #000; - cursor: pointer; - list-style: none; - margin: 2px; - outline: none; - padding: 0; - text-decoration: none; - vertical-align: middle; -} - -/* Pseudo-rounded corners. */ -.goog-menu-button-outer-box, -.goog-menu-button-inner-box { - border-style: solid; - border-color: #aaa; - vertical-align: top; -} - -.goog-menu-button-outer-box { - margin: 0; - border-width: 1px 0; - padding: 0; -} - -.goog-menu-button-inner-box { - margin: 0 -1px; - border-width: 0 1px; - padding: 3px 4px; -} - -/* Pre-IE7 IE hack; ignored by IE7 and all non-IE browsers. */ -* html .goog-menu-button-inner-box { - /* IE6 needs to have the box shifted to make the borders line up. */ - left: -1px; -} - -/* Pre-IE7 BiDi fixes. */ -* html .goog-menu-button-rtl .goog-menu-button-outer-box { - /* @noflip */ - left: -1px; - /* @noflip */ - right: auto; -} - -* html .goog-menu-button-rtl .goog-menu-button-inner-box { - /* @noflip */ - right: auto; -} - -/* IE7-only hack; ignored by all other browsers. */ -*:first-child+html .goog-menu-button-inner-box { - /* IE7 needs to have the box shifted to make the borders line up. */ - left: -1px; -} - -/* IE7 BiDi fix. */ -*:first-child+html .goog-menu-button-rtl .goog-menu-button-inner-box { - /* @noflip */ - left: 1px; - /* @noflip */ - right: auto; -} - -/* Safari-only hacks. */ -::root .goog-menu-button, -::root .goog-menu-button-outer-box, -::root .goog-menu-button-inner-box { - /* Required to make pseudo-rounded corners work on Safari. */ - line-height: 0; -} - -::root .goog-menu-button-caption, -::root .goog-menu-button-dropdown { - /* Required to make pseudo-rounded corners work on Safari. */ - line-height: normal; -} - -/* State: disabled. */ -.goog-menu-button-disabled { - background-image: none !important; - opacity: 0.3; - -moz-opacity: 0.3; - filter: alpha(opacity = 30); -} - -.goog-menu-button-disabled .goog-menu-button-outer-box, -.goog-menu-button-disabled .goog-menu-button-inner-box, -.goog-menu-button-disabled .goog-menu-button-caption, -.goog-menu-button-disabled .goog-menu-button-dropdown { - color: #333 !important; - border-color: #999 !important; -} - -/* Pre-IE7 IE hack; ignored by IE7 and all non-IE browsers. */ -* html .goog-menu-button-disabled { - margin: 2px 1px !important; - padding: 0 1px !important; -} - -/* IE7-only hack; ignored by all other browsers. */ -*:first-child+html .goog-menu-button-disabled { - margin: 2px 1px !important; - padding: 0 1px !important; -} - -/* State: hover. */ -.goog-menu-button-hover .goog-menu-button-outer-box, -.goog-menu-button-hover .goog-menu-button-inner-box { - border-color: #9cf #69e #69e #7af !important; /* Hover border wins. */ -} - -/* State: active, open. */ -.goog-menu-button-active, -.goog-menu-button-open { - background-color: #bbb; - background-position: bottom left; -} - -/* State: focused. */ -.goog-menu-button-focused .goog-menu-button-outer-box, -.goog-menu-button-focused .goog-menu-button-inner-box { - border-color: orange; -} - -/* Caption style. */ -.goog-menu-button-caption { - padding: 0 4px 0 0; - vertical-align: top; -} - -/* Dropdown arrow style. */ -.goog-menu-button-dropdown { - height: 15px; - width: 7px; - /* Client apps may override the URL at which they serve the sprite. */ - background: url(image/editortoolbar.png) no-repeat -388px 0; - vertical-align: top; -} - -/* Pill (collapsed border) styles. */ -/* TODO(gboyer): Remove specific menu button styles and have any button support being a menu button. */ -.goog-menu-button-collapse-right, -.goog-menu-button-collapse-right .goog-menu-button-outer-box, -.goog-menu-button-collapse-right .goog-menu-button-inner-box { - margin-right: 0; -} - -.goog-menu-button-collapse-left, -.goog-menu-button-collapse-left .goog-menu-button-outer-box, -.goog-menu-button-collapse-left .goog-menu-button-inner-box { - margin-left: 0; -} - -.goog-menu-button-collapse-left .goog-menu-button-inner-box { - border-left: 1px solid #fff; -} - -.goog-menu-button-collapse-left.goog-menu-button-checked -.goog-menu-button-inner-box { - border-left: 1px solid #ddd; -} - -/* ************************* goog palette.css *********************** */ -.goog-palette { - cursor: default; - outline: none; -} - -.goog-palette-table { - border: 1px solid #666; - border-collapse: collapse; - margin: 5px; -} - -.goog-palette-cell { - border: 0; - border-right: 1px solid #666; - cursor: pointer; - height: 18px; - margin: 0; - text-align: center; - vertical-align: middle; - width: 18px; -} - -/* ******************* goog.colorpallete ************************ */ -.goog-palette-cell .goog-palette-colorswatch { - border: none; - font-size: x-small; - height: 18px; - position: relative; - width: 18px; -} - -.goog-palette-cell-hover .goog-palette-colorswatch { - border: 1px solid #fff; - height: 16px; - width: 16px; -} - -.goog-palette-cell-selected .goog-palette-colorswatch { - /* Client apps may override the URL at which they serve the sprite. */ - background: url(image/editortoolbar.png) no-repeat -368px 0; - border: 1px solid #333; - color: #fff; - font-weight: bold; - height: 16px; - width: 16px; -} - -.goog-palette-customcolor { - background-color: #fafafa; - border: 1px solid #eee; - color: #666; - font-size: x-small; - height: 15px; - position: relative; - width: 15px; -} - -.goog-palette-cell-hover .goog-palette-customcolor { - background-color: #fee; - border: 1px solid #f66; - color: #f66; -} - -/* *************************** goog colormenubutton.css ********************* */ -/* Color indicator. */ -.goog-color-menu-button-indicator { - border-bottom: 4px solid #f0f0f0; -} - -/* Thinner padding for color picker buttons, to leave room for the indicator. */ -.goog-color-menu-button .goog-menu-button-inner-box, -.goog-toolbar-color-menu-button .goog-toolbar-menu-button-inner-box { - padding-top: 2px !important; - padding-bottom: 2px !important; -} - -/* ***************************** goog checkbox.css **************************** */ -.goog-checkbox { - border: 1px solid #1C5180; - display: -moz-inline-box; - display: inline-block; - font-size: 1px; /* Fixes the height in IE6 */ - height: 11px; - margin: 0 4px 0 1px; - vertical-align: text-bottom; - width: 11px; -} - -.goog-checkbox-checked { - background: #ccc url(image/check-sprite.gif) no-repeat 2px center; -} - -.goog-checkbox-undetermined { - background: #bbb url(image/check-sprite.gif) no-repeat 2px center; -} - -.goog-checkbox-unchecked { - background: #fff; -} - -.goog-checkbox-disabled { - border: 1px solid lightgray; - background-position: -7px; -} - -/* ***************************** goog tooltip.css **************************** */ -.goog-tooltip { - background: #ffe; - border: 1px solid #999; - border-width: 1px 2px 2px 1px; - padding: 6px; - z-index: 30000; -} diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/arrow-pointer.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/arrow-pointer.gif deleted file mode 100644 index 4cf4b7cc9b..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/arrow-pointer.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/arrow.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/arrow.gif deleted file mode 100644 index 726641f25e..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/arrow.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/background.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/background.gif deleted file mode 100644 index 8ce138aa69..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/background.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/button-bg.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/button-bg.gif deleted file mode 100644 index cd2d728b23..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/button-bg.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/check-sprite.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/check-sprite.gif deleted file mode 100644 index 44a927c49b..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/check-sprite.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/circle-pointer.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/circle-pointer.gif deleted file mode 100644 index e903babbbb..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/circle-pointer.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/circle.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/circle.gif deleted file mode 100644 index 76f18598f2..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/circle.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/circle1.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/circle1.gif deleted file mode 100644 index 5c79bfa5bc..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/circle1.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/circle2.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/circle2.gif deleted file mode 100644 index f36ca3b4f8..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/circle2.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/clipart-pointer.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/clipart-pointer.gif deleted file mode 100644 index d4212c160f..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/clipart-pointer.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/clipart.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/clipart.gif deleted file mode 100644 index d6332aaaf0..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/clipart.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/compass-pointer.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/compass-pointer.gif deleted file mode 100644 index c3e977851e..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/compass-pointer.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/compass.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/compass.gif deleted file mode 100644 index 61ead03f87..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/compass.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/coordinates.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/coordinates.gif deleted file mode 100644 index 5c386111cb..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/coordinates.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/curve-pointer.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/curve-pointer.gif deleted file mode 100644 index 0ff3d9436f..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/curve-pointer.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/curve.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/curve.gif deleted file mode 100644 index 3094efb05d..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/curve.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/demo.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/demo.gif deleted file mode 100644 index 58548d2af2..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/demo.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/doc.png b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/doc.png deleted file mode 100644 index 2647baa92a..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/doc.png and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/editortoolbar.png b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/editortoolbar.png deleted file mode 100644 index 1dc5c8e658..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/editortoolbar.png and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/eraser.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/eraser.gif deleted file mode 100644 index b98e80ab46..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/eraser.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/freeline-pointer.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/freeline-pointer.gif deleted file mode 100644 index d7e978bdbe..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/freeline-pointer.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/freeline.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/freeline.gif deleted file mode 100644 index cf79e0b3ad..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/freeline.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/info-pointer.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/info-pointer.gif deleted file mode 100644 index 16e8e07aec..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/info-pointer.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/info.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/info.gif deleted file mode 100644 index 5571d517e2..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/info.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/left.png b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/left.png deleted file mode 100644 index 107f0cee43..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/left.png and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/line.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/line.gif deleted file mode 100644 index c7a4834d20..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/line.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/pencil.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/pencil.gif deleted file mode 100644 index fa294f93b0..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/pencil.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/point-pointer.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/point-pointer.gif deleted file mode 100644 index 3832023331..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/point-pointer.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/point.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/point.gif deleted file mode 100644 index eaf2894762..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/point.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/pointer-pointer.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/pointer-pointer.gif deleted file mode 100644 index fae92832ab..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/pointer-pointer.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/pointer.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/pointer.gif deleted file mode 100644 index adcc7cec8e..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/pointer.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/rect-pointer.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/rect-pointer.gif deleted file mode 100644 index eaba7b2a0a..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/rect-pointer.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/rectangle.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/rectangle.gif deleted file mode 100644 index 1aa33f5d41..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/rectangle.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/resize.png b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/resize.png deleted file mode 100644 index e7a7ee2167..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/resize.png and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/right.jpeg b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/right.jpeg deleted file mode 100644 index 7e56ef939b..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/right.jpeg and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/ruler-pointer.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/ruler-pointer.gif deleted file mode 100644 index eff6b70350..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/ruler-pointer.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/ruler.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/ruler.gif deleted file mode 100644 index d837f97eb1..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/ruler.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/ruler_compass.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/ruler_compass.gif deleted file mode 100644 index 3f97011851..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/ruler_compass.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/save.png b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/save.png deleted file mode 100644 index 58925f36ac..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/save.png and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/segment.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/segment.gif deleted file mode 100644 index 2ae1511ed3..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/segment.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/text-pointer.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/text-pointer.gif deleted file mode 100644 index ea2356e17b..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/text-pointer.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/text.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/text.gif deleted file mode 100644 index d60093e8d2..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/text.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/tools.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/tools.gif deleted file mode 100644 index 03d1d94ee9..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/tools.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/trash.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/trash.gif deleted file mode 100644 index 60831a728d..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/trash.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/underline-pointer.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/underline-pointer.gif deleted file mode 100644 index 9b819cc5c5..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/underline-pointer.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/underline.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/underline.gif deleted file mode 100644 index 2defb37591..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/underline.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/undo.png b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/undo.png deleted file mode 100644 index b9994fc904..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/undo.png and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/zoom-in.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/zoom-in.gif deleted file mode 100644 index 8aff9bdd95..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/zoom-in.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/zoom-out.gif b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/zoom-out.gif deleted file mode 100644 index e058299b67..0000000000 Binary files a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/image/zoom-out.gif and /dev/null differ diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/translate.js b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/translate.js deleted file mode 100644 index 2b1ab03a7c..0000000000 --- a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/translate.js +++ /dev/null @@ -1,77 +0,0 @@ -function getParameterByName(name) { - name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]"); - var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), - results = regex.exec(location.search); - return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " ")); -} - -var lang = getParameterByName('lang'); -var ru = -{ -// Tooltips for buttons - "Common tools": "Общие инструменты", - "Zoom in": "Увеличить", - "Zoom out": "Уменьшить", - "Show coordinates": "Показывать координаты", - "Clear all": "Очистить все", - "Clear traces": "Очистить следы", - "Show information about selected element": "Информация об элементе", - - "Ruler-and-compass constructions": "Построения циркулем и линейкой", - "Single point": "Точка", - "Line through two points": "Прямая, проходящая через две точки", - "Line segment connecting two points": "Отрезок, соединяющий две точки", - "Circle with radius equals to the given segment": "Окружность с заданным радиусом", - "Circle with given center": "Окружность с заданным центром", - - "Free hand drawing": "Рисование", - "Insert picture": "Вставить картинку", - "Change whiteboard background": "Изменить обои", - "Curve": "Кривая линяя", - "Polyline": "Ломаная линия", - "Rectangle": "Прямоугольник", - "Circle": "Окружность", - "Text box": "Текст", - "Highlight board area": "Выделить участок доски", - "Draw an arrow": "Стрелка", - "Highlight a point at whiteboard": "Отметить точку на доске", - "Undo": "аннулировать", - "Save": "экономить", - "Document adding tools": "Документ добавление инструментов", - "Add document to whiteboard": "Добавление документа в доску", - "Go to previous page of the Doc": "Перейти к предыдущей странице документа", - "Go to next page of the Doc": "Переход к следующей странице документа", - "Cancel": "отменить", - -// Controls at the info dialog - "Click to select other element": "Нажмите для выбора следующего элемента", - "Hide": "Скрыть", - "Click to hide element": "Нажмите, чтобы скрыть элемент", - "Trace": "След", - "Color": "Цвет", - "Click to select color": "Нажмите для выбора цвета", - "JSON code for drawing": "JSON-код для рисунка", - -// Element Labels in the info dialog - "ClipArt does not exist": "Картинка отсутствует", - "ClipArt from [{$label}]": "Картинка, источник {$label}", - "Point does not exist": "Точка не сушествует", - "Point: [{$x},{$y}]": "Точка [{$x},{$y}]", - "Line does not exist": "Линия не существует", - "Line [{$fromx},{$fromy}] - [{$tox},{$toy}]": "Линия от [{$fromx},{$fromy}] до [{$tox},{$toy}]", - "Circle does not exist": "Окружность не существует", - "Circle [{$x},{$y}] -> {$r}": "Окружность [{$x},{$y}] -> {$r}", - "Curve does not exists": "Кривая не существует", - "Rectangle does not exist": "Прямоугольник не существует", - "Text does not exist": "Текст не существует", - "Text [{$label}]": "Текст [{$label}]", - "Underline does not exists": "Выделение не существует", - "Underline": "Выделение", - "Arrow does not exists": "Стрелка не существует", - "Arrow": "Стрелка", - "Pointer does not exists": "Указатель не существует", - "Pointer [{$x},{$y}]": "Указатель на [{$x},{$y}]", - -// Messages - "This browser doesn''t support graphics. Please use another web browser.": "Ваш браузер не поддерживает графику. Пожалуйста, используйте другой браузер" -}; \ No newline at end of file diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/wb-helper.js b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/wb-helper.js deleted file mode 100644 index 8311565159..0000000000 --- a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/wb-helper.js +++ /dev/null @@ -1,116 +0,0 @@ -/** - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -var wbClipArtList = ''; -var wbDocList=''; -var wbCurrentDoc=''; -var wbCurrentDocComponentList=''; -var wbCurrentDocPage=''; -var wbElementCollection=''; - -function addWBElement(m) { - wbElementCollection.acceptJsonStr(m); -} - -function parseWB(m) { - wbElementCollection.parseJson(m); -} - -function wbDeleteElement(m) { - wbElementCollection.acceptDeletion(m); -} - -function wbUndo(m) { - if (JSON.stringify(m.deleteList) != '\"\"') { - var deleteList = JSON.stringify(m.deleteList).substring(1, JSON.stringify(m.deleteList).length - 1).split(","); - for (var i = 0; i < deleteList.length; i++) { - wbDeleteElement(deleteList[i]) - } - } - - var changeList = m.changeList; - for (var i = 0; i < changeList.length; i++) { - addWBElement(JSON.stringify(changeList[i])); - } -} - -function wbMessage(msg) { - var message = jQuery.parseJSON(msg) - if (message && message.type == "addElement") { - addWBElement(JSON.stringify(message.json)); - } else if (message && message.type == "parseWB") { - parseWB(message.json); - } else if (message && message.type == "undoList") { - wbUndo(message); - } - else if (message && message.type == "clipArtList") { - wbClipArtList = message.json; - } - else if (message && message.type == "documentList") { - wbDocList = message.json; - } - else if (message && message.type == "documentComponentList") { - wbCurrentDocComponentList = message.json; - } - else if (message && message.type == "addBackground") { - if( wbCurrentDocPage!=message.json.url) { - whiteboard.acceptBackground(JSON.stringify(message.json)); - var b=message.json.url; - if(b != '') { - wbCurrentDoc = b.substring(b.lastIndexOf("/") + 1, b.lastIndexOf(".")); - wbCurrentDocPage = b; - wbCurrentDocComponentList = ""; - } else { - wbCurrentDoc = ''; - wbCurrentDocPage = ''; - wbCurrentDocComponentList = ''; - } - } - } else if (message && message.type == "eraseElements") { - whiteboard.collections.main.clear(); - whiteboard.collections.tracer.clear(); - whiteboard.redrawAll() - } -} - -function initWB(cbUrl, markupId, elems, bg) { - wbCallbackUrl = cbUrl; - whiteboard = bay.whiteboard.Create(); - wbElementCollection = whiteboard.getMainCollection(); - whiteboard.getMainCollection().onChange = function(element) { - changedElement=this.getJson(element); - Wicket.Ajax.get({u: wbCallbackUrl, ep: {editedElement: changedElement}}); - }; - whiteboard.render(document.getElementById(markupId)); - whiteboard.setBoundaries(0, 0, 0, 0); - window.onload = function() { - Wicket.Ajax.get({u: wbCallbackUrl, ep: {clipArt: "clipArt"}}); - Wicket.Ajax.get({u: wbCallbackUrl, ep: {docList: "docList"}}); - }; - whiteboard.onBackground = function(e) { - Wicket.Ajax.get({u: wbCallbackUrl, ep: {background: whiteboard.backgroundJson()}}); - }; - if (elems) { - wbElementCollection.rebuild(elems); - } - if (bg) { - whiteboard.backgroundJson(bg); - var b = bg.url; - wbCurrentDoc = b.substring(b.lastIndexOf("/") + 1, b.lastIndexOf(".")); - wbCurrentDocPage = b; - wbCurrentDocComponentList = ""; - } -} diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/whiteboard.css b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/whiteboard.css deleted file mode 100644 index 0dff533cb0..0000000000 --- a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/whiteboard.css +++ /dev/null @@ -1,262 +0,0 @@ -td, canvas, button { - -webkit-tap-highlight-color: transparent; - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - outline: none; -} - -table.bwb_layout{ - width: 100%; - height:100%; - table-layout: fixed -} - -td.bwb_toolbar{ - width: 50px; - height:100%; - vertical-align:top; -} - -.bwb_toolbox{ - position: absolute; -} - -td.bwb_drawarea{ - width: 100%; - height:100%; - border: 2px inset; - border-radius: 10px; - vertical-align: top; -} - -td.bwb_drawarea svg{ - display: block; - margin: 0px; - padding: 0px; -} - -.bwb_toolbarButton { - border: 2px outset; - border-radius: 5px; - background-repeat: no-repeat; - background-position:center; - background-color: WhiteSmoke; - background-size: 90% 90%; - display: inline-block; -} - -.bwb_toolbarButton.info { - background-image: url('image/info.gif'); -} -.bwb_infoCursor { - cursor: url('image/info-pointer.gif'),auto; -} -.bwb_toolbarButton.zoom-in { - background-image: url('image/zoom-in.gif'); -} -.bwb_toolbarButton.zoom-out { - background-image: url('image/zoom-out.gif'); -} -.bwb_toolbarButton.tools { - background-image: url('image/tools.gif'); -} -.bwb_toolbarButton.coordinates { - background-image: url('image/coordinates.gif'); -} -.bwb_toolbarButton.eraseAll { - background-image: url('image/trash.gif'); -} -.bwb_toolbarButton.eraseTrace { - background-image: url('image/eraser.gif'); -} -.bwb_toolbarButton.geometry { - background-image: url('image/ruler_compass.gif'); -} -.bwb_toolbarButton.point { - background-image: url('image/point.gif'); -} -.bwb_toolbarButton.ruler { - background-image: url('image/line.gif'); -} -.bwb_toolbarButton.segment { - background-image: url('image/segment.gif'); -} -.bwb_toolbarButton.compass { - background-image: url('image/circle1.gif'); -} -.bwb_toolbarButton.circle { - background-image: url('image/circle2.gif'); -} -.bwb_pointCursor { - cursor: url('image/point-pointer.gif'),auto; -} -.bwb_rulerCursor { - cursor: url('image/ruler-pointer.gif'),auto; -} -.bwb_compassCursor { - cursor: url('image/compass-pointer.gif'),auto; -} - -.bwb_toolbarButton.pencil { - background-image: url('image/pencil.gif'); -} -.bwb_toolbarButton.curve { - background-image: url('image/curve.gif'); -} -.bwb_toolbarButton.freeline { - background-image: url('image/freeline.gif'); -} -.bwb_toolbarButton.rectangle { - background-image: url('image/rectangle.gif'); -} -.bwb_toolbarButton.pencilcircle { - background-image: url('image/circle.gif'); -} -.bwb_toolbarButton.text { - background-image: url('image/text.gif'); -} -.bwb_toolbarButton.underline { - background-image: url('image/underline.gif'); -} -.bwb_toolbarButton.arrow { - background-image: url('image/arrow.gif'); -} -.bwb_toolbarButton.pointer { - background-image: url('image/pointer.gif'); -} -.bwb_curveCursor { - cursor: url('image/curve-pointer.gif'),auto; -} -.bwb_pencilLineCursor { - cursor: url('image/freeline-pointer.gif'),auto; -} -.bwb_rectCursor { - cursor: url('image/rect-pointer.gif'),auto; -} -.bwb_circleCursor { - cursor: url('image/circle-pointer.gif'),auto; -} -.bwb_textCursor { - cursor: url('image/text-pointer.gif'),auto; -} -.bwb_underlineCursor { - cursor: url('image/underline-pointer.gif'),auto; -} -.bwb_arrowCursor { - cursor: url('image/arrow-pointer.gif'),auto; -} -.bwb_pointerCursor { - cursor: url('image/pointer-pointer.gif'),auto; -} - -.bwb_toolbarButton.addDoc { - background-image: url('image/background.gif'); -} -.bwb_toolbarButton.clipart { - background-image: url('image/clipart.gif'); -} -.bwb_clipartCursor { - cursor: url('image/clipart-pointer.gif'),auto; -} - -.bwb_toolbarButton.undo { - background-image: url('image/undo.png'); -} - -.bwb_toolbarButton.save { - background-image: url('image/save.png'); -} - -.bwb_toolbarButton.docs { - background-image: url('image/doc.png'); -} - -.bwb_toolbarButton.left { - background-image: url('image/left.png'); -} - -.bwb_toolbarButton.right { - background-image: url('image/right.jpeg'); -} - - - -.pressedButton { - border-style: inset; -} - -.bwb_infoDialog { - margin: 3px; - border: 3px outset; - border-radius: 6px; - background-color: WhiteSmoke; - position: absolute; -} - -.bwb_infoDialog button{ - border-radius: 8px; -} - -.bwb_infoDialog .bwb_navigate{ - border-radius: 8px; - width: 20px; - height: 20px; - font-weight: bold; - font-size: 10px; -} - -.bwb_infoDialog .bwb_labelInput{ - border-radius: 3px; - width: 80px; - display: block; - position: relative; - left: 3px; -} - -.bwb_infoDialog .bwb_objDesc{ - font-weight: bold; - font-size: 10px; - position: relative; - left: 3px; -} - -.bwb_infoDialog .bwb_traceCheck{ - font-weight: bold; - font-size: 10px; - position: relative; - left: 3px; - display: inline-block; -} - -.bwb_codeArea{ - border-radius: 6px; - width: 800px; - height: 400px; -} - - - -.bwb_pictureUrlDialog { - margin: 3px; - width: 610px; - border: 3px outset; - border-radius: 6px; - background-color: WhiteSmoke; - position: absolute; -} - -.bwb_pictureUrlDialog button{ - border-radius: 8px; -} - -.bwb_pictureUrlInput{ - border-radius: 3px; - width: 600px; - display: block; - position: relative; - left: 3px; -} diff --git a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/whiteboard.js b/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/whiteboard.js deleted file mode 100644 index d7637b6784..0000000000 --- a/whiteboard-parent/whiteboard/src/main/resources/org/wicketstuff/whiteboard/resource/whiteboard.js +++ /dev/null @@ -1,15043 +0,0 @@ -/** - * https://github.com/bay73/whiteboard - */ -var COMPILED = !0, - goog = goog || {}; -goog.global = this; -goog.DEBUG = !0; -goog.LOCALE = "en"; -goog.TRUSTED_SITE = !0; -goog.provide = function(a) { - if (!COMPILED) { - if (goog.isProvided_(a)) throw Error('Namespace "' + a + '" already declared.'); - delete goog.implicitNamespaces_[a]; - for (var b = a; - (b = b.substring(0, b.lastIndexOf("."))) && !goog.getObjectByName(b);) goog.implicitNamespaces_[b] = !0 - } - goog.exportPath_(a) -}; -goog.setTestOnly = function(a) { - if (COMPILED && !goog.DEBUG) throw a = a || "", Error("Importing test-only code into non-debug environment" + a ? ": " + a : "."); -}; -COMPILED || (goog.isProvided_ = function(a) { - return !goog.implicitNamespaces_[a] && !! goog.getObjectByName(a) -}, goog.implicitNamespaces_ = {}); -goog.exportPath_ = function(a, b, c) { - a = a.split("."); - c = c || goog.global; - !(a[0] in c) && c.execScript && c.execScript("var " + a[0]); - for (var f; a.length && (f = a.shift());)!a.length && goog.isDef(b) ? c[f] = b : c = c[f] ? c[f] : c[f] = {} -}; -goog.getObjectByName = function(a, b) { - for (var c = a.split("."), f = b || goog.global, g; g = c.shift();) - if (goog.isDefAndNotNull(f[g])) f = f[g]; - else return null; - return f -}; -goog.globalize = function(a, b) { - var c = b || goog.global, - f; - for (f in a) c[f] = a[f] -}; -goog.addDependency = function(a, b, c) { - if (!COMPILED) { - var f; - a = a.replace(/\\/g, "/"); - for (var g = goog.dependencies_, h = 0; f = b[h]; h++) g.nameToPath[f] = a, a in g.pathToNames || (g.pathToNames[a] = {}), g.pathToNames[a][f] = !0; - for (f = 0; b = c[f]; f++) a in g.requires || (g.requires[a] = {}), g.requires[a][b] = !0 - } -}; -goog.ENABLE_DEBUG_LOADER = !0; -goog.require = function(a) { - if (!COMPILED && !goog.isProvided_(a)) { - if (goog.ENABLE_DEBUG_LOADER) { - var b = goog.getPathFromDeps_(a); - if (b) { - goog.included_[b] = !0; - goog.writeScripts_(); - return - } - } - a = "goog.require could not find: " + a; - goog.global.console && goog.global.console.error(a); - throw Error(a); - } -}; -goog.basePath = ""; -goog.nullFunction = function() {}; -goog.identityFunction = function(a, b) { - return a -}; -goog.abstractMethod = function() { - throw Error("unimplemented abstract method"); -}; -goog.addSingletonGetter = function(a) { - a.getInstance = function() { - if (a.instance_) return a.instance_; - goog.DEBUG && (goog.instantiatedSingletons_[goog.instantiatedSingletons_.length] = a); - return a.instance_ = new a - } -}; -goog.instantiatedSingletons_ = []; -!COMPILED && goog.ENABLE_DEBUG_LOADER && (goog.included_ = {}, goog.dependencies_ = { - pathToNames: {}, - nameToPath: {}, - requires: {}, - visited: {}, - written: {} -}, goog.inHtmlDocument_ = function() { - var a = goog.global.document; - return "undefined" != typeof a && "write" in a -}, goog.findBasePath_ = function() { - if (goog.global.CLOSURE_BASE_PATH) goog.basePath = goog.global.CLOSURE_BASE_PATH; - else if (goog.inHtmlDocument_()) - for (var a = goog.global.document.getElementsByTagName("script"), b = a.length - 1; 0 <= b; --b) { - var c = a[b].src, - f = c.lastIndexOf("?"), - f = -1 == f ? c.length : f; - if ("base.js" == c.substr(f - 7, 7)) { - goog.basePath = c.substr(0, f - 7); - break - } - } -}, goog.importScript_ = function(a) { - var b = goog.global.CLOSURE_IMPORT_SCRIPT || goog.writeScriptTag_; - !goog.dependencies_.written[a] && b(a) && (goog.dependencies_.written[a] = !0) -}, goog.writeScriptTag_ = function(a) { - if (goog.inHtmlDocument_()) { - var b = goog.global.document; - if ("complete" == b.readyState) { - if (/\bdeps.js$/.test(a)) return !1; - throw Error('Cannot write "' + a + '" after document load'); - } - b.write('