Author: amarkhel
Date: 2009-01-23 08:45:49 -0500 (Fri, 23 Jan 2009)
New Revision: 12396
Added:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/modalpanel/
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/modalpanel/AlbumPopupHelper.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/modalpanel/ConfirmationPopupHelper.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/modalpanel/ImagePopupHelper.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/modalpanel/LinkBuilder.java
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/modalpanel/test.java
Log:
Added items remotely
E:\richfaces\test-applications\realworld\web\src\main\java\org\richfaces\realworld\modalpanel
Added:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/modalpanel/AlbumPopupHelper.java
===================================================================
---
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/modalpanel/AlbumPopupHelper.java
(rev 0)
+++
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/modalpanel/AlbumPopupHelper.java 2009-01-23
13:45:49 UTC (rev 12396)
@@ -0,0 +1,109 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.realworld.modalpanel;
+
+import java.io.Serializable;
+
+import javax.faces.event.ActionEvent;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.realworld.domain.Album;
+import org.richfaces.realworld.manager.AlbumManager;
+
+@Name("albumPopupHelper")
+(a)Scope(ScopeType.CONVERSATION)
+public class AlbumPopupHelper implements Serializable{
+
+ private static final long serialVersionUID = 2561824019376412988L;
+
+ private String caption;
+
+ private String actionName;
+
+ @In(create=true, required=true) @Out
+ private Album album;
+
+ private Album parent;
+
+ @In(create=true, required=true)
+ private AlbumManager albumManager;
+
+ public void initAlbumData( String actionName, String caption, Album album){
+ this.caption = caption;
+ this.actionName = actionName;
+ if(null != album){
+ this.album = album;
+ this.parent = album.getParent();
+ }else{
+ this.album = new Album();
+ this.parent = null;
+ }
+
+ }
+
+ public void initAlbumData( String actionName, String caption, Album album, Album
parent){
+ this.caption = caption;
+ this.actionName = actionName;
+ if(null != album){
+ this.album = album;
+ }else{
+ this.album = new Album();
+ }
+ this.parent= parent;
+ }
+
+ public void editAlbum(ActionEvent event){
+ albumManager.editAlbum(this.album);
+ }
+
+ public String getCaption() {
+ return caption;
+ }
+
+ public void setCaption(String caption) {
+ this.caption = caption;
+ }
+
+ public String getActionName() {
+ return actionName;
+ }
+
+ public void setActionName(String actionName) {
+ this.actionName = actionName;
+ }
+
+ public void addAlbum(ActionEvent event){
+ this.album.setParent(parent);
+ albumManager.addAlbum();
+ }
+
+ public Album getParent() {
+ return parent;
+ }
+
+ public void setParent(Album parent) {
+ this.parent = parent;
+ }
+}
Property changes on:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/modalpanel/AlbumPopupHelper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/modalpanel/ConfirmationPopupHelper.java
===================================================================
---
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/modalpanel/ConfirmationPopupHelper.java
(rev 0)
+++
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/modalpanel/ConfirmationPopupHelper.java 2009-01-23
13:45:49 UTC (rev 12396)
@@ -0,0 +1,106 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.realworld.modalpanel;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+
+import javax.faces.event.ActionEvent;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.realworld.domain.Album;
+import org.richfaces.realworld.domain.Image;
+import org.richfaces.realworld.domain.MetaTag;
+import org.richfaces.realworld.manager.AlbumManager;
+import org.richfaces.realworld.manager.ImageManager;
+
+@Name("confirmationPopupHelper")
+(a)Scope(ScopeType.CONVERSATION)
+public class ConfirmationPopupHelper implements Serializable{
+
+ private static final long serialVersionUID = 2561824019376412988L;
+
+ private String caption;
+
+ private String actionName;
+
+ @In(create=true, required=true) @Out(required=false)
+ private Image image;
+
+ @In(create=true, required=true) @Out(required=false)
+ private Album album;
+
+ @In(create=true, required=true)
+ private AlbumManager albumManager;
+
+ @In(create=true, required=true)
+ private ImageManager imageManager;
+
+ public void initImagePopup( String actionName, String caption, Image image){
+ this.caption = caption;
+ this.actionName = actionName;
+ if(null != image){
+ this.image = image;
+ image.setMeta(new ArrayList<MetaTag>(image.getTags()));
+ }else{
+ this.image = new Image();
+ }
+ }
+
+ public void initAlbumData( String actionName, String caption, Album album){
+ this.caption = caption;
+ this.actionName = actionName;
+ if(null != album){
+ this.album = album;
+ }else{
+ this.album = new Album();
+ }
+ }
+
+ public void deleteAlbum(ActionEvent event){
+ albumManager.deleteAlbum(this.album);
+ }
+
+ public String getCaption() {
+ return caption;
+ }
+
+ public void setCaption(String caption) {
+ this.caption = caption;
+ }
+
+ public String getActionName() {
+ return actionName;
+ }
+
+ public void setActionName(String actionName) {
+ this.actionName = actionName;
+ }
+
+ public void deleteImage(ActionEvent event){
+ imageManager.deleteImage(this.image);
+ }
+
+}
Property changes on:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/modalpanel/ConfirmationPopupHelper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/modalpanel/ImagePopupHelper.java
===================================================================
---
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/modalpanel/ImagePopupHelper.java
(rev 0)
+++
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/modalpanel/ImagePopupHelper.java 2009-01-23
13:45:49 UTC (rev 12396)
@@ -0,0 +1,61 @@
+/**
+ * License Agreement.
+ *
+ * JBoss RichFaces - Ajax4jsf Component Library
+ *
+ * Copyright (C) 2007 Exadel, Inc.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1 as published by the Free Software Foundation.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+package org.richfaces.realworld.modalpanel;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+
+import javax.faces.event.ActionEvent;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Out;
+import org.jboss.seam.annotations.Scope;
+import org.richfaces.realworld.domain.Image;
+import org.richfaces.realworld.domain.MetaTag;
+import org.richfaces.realworld.manager.ImageManager;
+
+@Name("imagePopupHelper")
+(a)Scope(ScopeType.CONVERSATION)
+public class ImagePopupHelper implements Serializable{
+
+ private static final long serialVersionUID = 2561824019376412988L;
+
+ @In(create=true, required=true) @Out
+ private Image image;
+
+ @In(create=true, required=true)
+ private ImageManager imageManager;
+
+ public void initImagePopup(Image image){
+ if(null != image){
+ this.image = image;
+ image.setMeta(new ArrayList<MetaTag>(image.getTags()));
+ }else{
+ this.image = new Image();
+ }
+ }
+
+ public void editImage(ActionEvent event){
+ imageManager.editImage(this.image);
+ }
+}
Property changes on:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/modalpanel/ImagePopupHelper.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/modalpanel/LinkBuilder.java
===================================================================
---
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/modalpanel/LinkBuilder.java
(rev 0)
+++
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/modalpanel/LinkBuilder.java 2009-01-23
13:45:49 UTC (rev 12396)
@@ -0,0 +1,116 @@
+package org.richfaces.realworld.modalpanel;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.faces.context.FacesContext;
+import javax.faces.model.SelectItem;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletRequest;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.In;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+@Name("linkBuilder")
+(a)Scope(ScopeType.CONVERSATION)
+public class LinkBuilder implements Serializable{
+
+ private static final long serialVersionUID = 2561824019376412988L;
+ private static final String MINI_FORMAT = "_mini";
+ private static final String MEDIUM_FORMAT = "_medium";
+ @In("#{messages['small']}") private String SMALL;
+ @In("#{messages['medium']}") private String MEDIUM;
+ @In("#{messages['full']}") private String FULL;
+ private Long scaleChoice = 1L;
+ private String generatedLink;
+ private String currentFormat = URL;
+ private String path;
+ private static String URL = "URL";
+ private static String HTML = "HTML";
+ private static String FORUM = "Forum";
+ private static String HTML_PATTERN = "<a href='%s'><img
src='%s' border='0'></a>";
+ private static String FORUM_PATTERN = "[URL=%s][IMG]%s[/IMG][/URL]";
+
+ public String getGeneratedLink() {
+
+ ServletRequest servletRequest =
((ServletRequest)(FacesContext.getCurrentInstance().getExternalContext().getRequest()));
+ ServletContext s =
(ServletContext)(FacesContext.getCurrentInstance().getExternalContext().getContext());
+ String protocol = servletRequest.getProtocol().equals("HTTP/1.1") ||
servletRequest.getProtocol().equals("HTTP/1.0") ? "http://" :
"https://" ;
+ String servletPath = protocol + servletRequest.getLocalAddr() + ":" +
servletRequest.getLocalPort() + s.getContextPath();
+ String link = null;
+ String tempPath = null;
+ if(getScaleChoice() == 3L){
+ tempPath = MINI_FORMAT;
+ }else if(getScaleChoice() == 2L){
+ tempPath = MEDIUM_FORMAT;
+ }else if(getScaleChoice() == 1L){
+ tempPath="";
+ }
+ if(null == path){
+ return "";
+ }
+ if(getCurrentFormat().equals(URL)){
+ link = servletPath + "/picture/" + transformPath(path, tempPath);
+ }else
+ if(getCurrentFormat().equals(HTML)){
+ link = String.format(HTML_PATTERN, servletPath, servletPath+ "/pictures/" +
transformPath(path, tempPath));
+ }else
+ if(getCurrentFormat().equals(FORUM)){
+ link = String.format(FORUM_PATTERN, servletPath, servletPath+ "/pictures/"
+ transformPath(path, tempPath));
+ }
+ return link;
+ }
+
+ private String transformPath(String target, String substitute){
+ String begin = target.substring(0, target.lastIndexOf("."));
+ String end = target.substring(target.lastIndexOf("."));
+ return begin + substitute + end;
+ }
+
+ public void setGeneratedLink(String generatedLink) {
+ this.generatedLink = generatedLink;
+ }
+
+ public List<SelectItem> getItems() {
+ List<SelectItem> list = new ArrayList<SelectItem>(4);
+ list.add(new SelectItem(Long.valueOf(1L), FULL));
+ list.add(new SelectItem(Long.valueOf(2L), MEDIUM));
+ list.add(new SelectItem(Long.valueOf(3L), SMALL));
+ return list;
+ }
+
+ public Long getScaleChoice() {
+ return scaleChoice;
+ }
+
+ public void setScaleChoice(Long scaleChoice) {
+ this.scaleChoice = scaleChoice;
+ }
+
+ public void selectFormat(String format){
+ setCurrentFormat(format);
+ }
+
+ public String getCurrentFormat() {
+ return currentFormat;
+ }
+
+ public void setCurrentFormat(String currentFormat) {
+ this.currentFormat = currentFormat;
+ }
+
+ public String getPath() {
+ return path;
+ }
+
+ public void setPath(String path) {
+ this.path = path;
+ }
+
+ public void setScale(Long choice){
+ setScaleChoice(choice);
+ }
+}
Property changes on:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/modalpanel/LinkBuilder.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
Added:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/modalpanel/test.java
===================================================================
---
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/modalpanel/test.java
(rev 0)
+++
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/modalpanel/test.java 2009-01-23
13:45:49 UTC (rev 12396)
@@ -0,0 +1,246 @@
+package org.richfaces.realworld.modalpanel;
+
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.geom.AffineTransform;
+import java.awt.image.AffineTransformOp;
+import java.awt.image.BufferedImage;
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.imageio.ImageIO;
+
+import org.richfaces.realworld.domain.Album;
+import org.richfaces.realworld.domain.Image;
+
+public class test {
+
+ /**
+ * @param args
+ * @throws IOException
+ */
+ public static void main(String[] args) throws IOException {
+ //String directory ="C:\\Documents and
Settings\\Administrator\\Desktop\\Fun";
+ //writeFiles(directory, "_mini", 100, 100);
+ //transform();
+ //String oldDirectory =
"E:\\richfaces\\test-applications\\realworld\\Upload\\amarkhel\\Cars\\Child2";
+ //String newDirectory =
"E:\\richfaces\\test-applications\\realworld\\Upload\\amarkhel\\Cars\\Child1\\Child2";
+ //renameDirectory(oldDirectory, newDirectory);
+
+ //Album a = init();
+ //renameAllImagesFromAlbumAndChilds(a, "Album", "Albums/Album");
+ String s1 = "amarkhel+qwe";
+ String s2 = "amarkhel-qwe+rich";
+ String s3 = "amarkhel";
+ String s4 = "";
+ String s5 = "+amarkhel";
+ String s6 = "a+b";
+ String s7 = "as+we+dfg-ret-df+deee-dff+ffgh";
+ ArrayList<String> a = new ArrayList<String>();
+ ArrayList<String> b = new ArrayList<String>();
+
+ //parse(s1, a, b);
+ a.clear();
+ b.clear();
+ //parse(s2, a, b);
+ a.clear();
+ b.clear();
+ //parse(s3, a, b);
+ a.clear();
+ b.clear();
+ //parse(s4, a, b);
+ a.clear();
+ b.clear();
+ //parse(s5, a, b);
+ a.clear();
+ b.clear();
+ //parse(s6, a, b);
+ a.clear();
+ b.clear();
+ //parse(s7, a, b);
+ a.clear();
+ b.clear();
+ }
+
+ private static Album init() {
+ Album a = new Album();
+ a.setName("Album");
+ Album a1 = new Album();
+ a1.setName("Album1");
+ Album a2 = new Album();
+ a2.setName("Album2");
+ Album a3 = new Album();
+ a3.setName("Album3");
+ Image i = new Image();
+ i.setPath("user/amarkhel/Album/i.jpg");
+ Image i1 = new Image();
+ i1.setPath("user/amarkhel/Album/Album1/i1.jpg");
+ Image i2 = new Image();
+ i2.setPath("user/amarkhel/Album/Album1/Album2/i2.jpg");
+ Image i3 = new Image();
+ i3.setPath("user/amarkhel/Album/Album3/i3.jpg");
+
+ a.addImage(i);
+ a1.addImage(i1);
+ a2.addImage(i2);
+ a3.addImage(i3);
+ a1.addChildAlbum(a2);
+ a.addChildAlbum(a1);
+ a.addChildAlbum(a3);
+ return a;
+ }
+
+ public static void renameAllImagesFromAlbumAndChilds(Album album, String replace,
+ String forReplace) {
+ for(Image image: album.getImages()){
+ System.out.println(image.getPath());
+ image.setPath(image.getPath().replaceAll(replace, forReplace));
+ System.out.println(image.getPath());
+ }
+
+ for(Album a:album.getChildAlbums()){
+ String replace2 = replace + "/" + a.getName();
+ String forReplace2 = forReplace + "/" + a.getName();
+ renameAllImagesFromAlbumAndChilds(a, replace2, forReplace2);
+ }
+ }
+
+ private static void writeFiles(String directory, String pattern, int width, int height)
{
+ File f = new File(directory);
+ for(String s: f.list()){
+ File temp = new File(directory +"\\"+ s);
+ if(temp.isDirectory() && !(directory +"\\"+
s).endsWith("avatars")){
+ writeFiles(directory +"\\"+ s,pattern, width, height);
+ }
+ if(s.endsWith(".jpg") &&
!s.endsWith("_mini.jpg")&& !s.endsWith("_medium.jpg")){
+ BufferedImage bsrc =null;
+ try {
+ bsrc = ImageIO.read(temp);
+ } catch (IOException e1) {
+ // TODO Auto-generated catch block
+ e1.printStackTrace();
+ }
+ BufferedImage bdest = new BufferedImage(width, height,
+ BufferedImage.TYPE_INT_RGB);
+ Graphics2D g = bdest.createGraphics();
+ int width2 = bsrc.getWidth();
+ int height2 = bsrc.getHeight();
+ double d = (double) width
+ / width2;
+ double e = (double) height / height2;
+ AffineTransform at = AffineTransform.getScaleInstance(d, e);
+ Map<RenderingHints.Key, Object> hints = new HashMap<RenderingHints.Key,
Object>();
+ hints.put(RenderingHints.KEY_INTERPOLATION,
RenderingHints.VALUE_INTERPOLATION_BILINEAR);
+ g.addRenderingHints(hints);
+ g.drawRenderedImage(bsrc, at);
+ String dest = transformPath(directory +"\\"+ s, pattern);
+ try {
+ ImageIO.write(bdest, "JPG", new File(dest));
+ } catch (IOException ex) {
+ // TODO Auto-generated catch block
+ ex.printStackTrace();
+ }
+ }
+ }
+ }
+
+ private static String transformPath(String target, String substitute){
+ String begin = target.substring(0, target.lastIndexOf("."));
+ String end = target.substring(target.lastIndexOf("."));
+ return begin + substitute + end;
+ }
+
+ private boolean parse(String str, List<String> adds, List<String> removes){
+ str = str.trim();
+ if(str.startsWith("+") || str.startsWith("-") ||
str.endsWith("+") || str.endsWith("-") || str.length() == 0){
+ System.out.println("Error");
+ return false;
+ }
+ if(str.lastIndexOf('+')==-1 && str.lastIndexOf('-')==-1){
+ adds.add(str);
+ return false;
+ }
+ int curIndex=0;
+ int prevIndex=0;
+ boolean prevSignplus =true;
+ boolean signedPreviousChar = false;
+ for(int i =0; i< str.length(); i++){
+ char c = str.charAt(i);
+ if(c == '+' ){
+ if(signedPreviousChar == false){
+
+ curIndex = i;
+ if(prevSignplus){
+ if(prevIndex ==0){
+ adds.add(str.substring(prevIndex, curIndex));
+ }else{
+ adds.add(str.substring(prevIndex+1, curIndex));
+ }
+ }else{
+ removes.add(str.substring(prevIndex+1, curIndex));
+ }
+ prevSignplus=true;
+ signedPreviousChar=true;
+ prevIndex =i;
+ }else {
+ System.out.println("Error");
+ return false;
+ }
+
+ }else if(c == '-'){
+ if(signedPreviousChar == false){
+ curIndex = i;
+ signedPreviousChar=true;
+ if(prevSignplus){
+ if(prevIndex ==0){
+ adds.add(str.substring(prevIndex, curIndex));
+ }else{
+ adds.add(str.substring(prevIndex+1, curIndex));
+ }
+ }else{
+ removes.add(str.substring(prevIndex+1, curIndex));
+ }
+ prevSignplus=false;
+
+ prevIndex =i;
+ }else {
+ System.out.println("Error");
+ return false;
+ }
+ }else{
+ signedPreviousChar=false;
+ }
+ }
+ char c2 = str.charAt(prevIndex);
+ if(c2 == '+'){
+ adds.add(str.substring(prevIndex+1));
+ }else if(c2 == '-'){
+ removes.add(str.substring(prevIndex+1));
+ }
+ adds.remove(0);
+ return true;
+ }
+
+ private static void transform() throws IOException{
+ File temp = new
File("E:\\richfaces\\test-applications\\realworld\\Upload\\galleries\\Nature\\1.jpg");
+ BufferedImage bsrc =null;
+ bsrc = ImageIO.read(temp);
+ AffineTransform transform = new AffineTransform();
+ //transform.scale(scalex, scaley);
+ //transform.shear(30, 30);
+ transform.translate(100, 100);
+ //transform.rotate(radians, bufferedImage.getWidth()/2,
+ //bufferedImage.getHeight()/2);
+
+ AffineTransformOp op = new AffineTransformOp(transform,
+ AffineTransformOp.TYPE_NEAREST_NEIGHBOR);
+ bsrc = op.filter(bsrc, null);
+ ImageIO.write(bsrc, "JPG", temp);
+ }
+}
Property changes on:
trunk/test-applications/realworld/web/src/main/java/org/richfaces/realworld/modalpanel/test.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native