sidewinder photo colour balancer

32
/* THIS is the F2 Version somewhere near completed for release . The old site was http://www.nicephotogjsp.net the new site is http://www.windsolarhybridaustralia.x10.mx This application is not principley written in Linux or Windows and is sometimes per version only usable in one or the other OS system. It is endevoured to be written for both and all Windows and NIX's OS's in the one download... cd C:\SideWinderColourBalancer\engine FILENAME SHOULD BE "SideWinderPhotoColourBalancer.java" written by Mr Samuel A Marchant Sydney NSW Australia October 2010 2015 version F2 cd C:\SideWinderColourBalancer\engine\sidewinderutil "MultiDimArr.java" written by Mr Samuel A Marchant Sydney NSW Australia October 2010 "C:\Program Files\Java\jdk1.5.0_07\bin\javac.exe" SidewinderPhotoColourBalancer.java "C:\Program Files\Java\jdk1.5.0_07\bin\java.exe" classpath "C:\SideWinderColourBalancer\engine";. SidewinderPhotoColourBalancer "C:\Program Files\Java\jdk1.6.0_22\bin\javac.exe" SidewinderPhotoColourBalancer.java "C:\Program Files\Java\jdk1.6.0_22\bin\java.exe" classpath "C:\SideWinderColourBalancer\engine";. SidewinderPhotoColourBalancer */ import java.awt.*; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.awt.Dimension; import java.awt.image.*; import javax.swing.event.*; import java.awt.event.ItemEvent; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.*; import javax.swing.filechooser.FileFilter; //import javax.swing.filechooser.FileNameExtensionFilter; import java.io.*; import javax.imageio.*; import javax.imageio.spi.*; import javax.imageio.stream.*; import javax.imageio.metadata.*; // import java.util.*; import java.util.List; import java.util.Iterator; //import sidewinderutil.*; //import sidewinderutil.MultiDimArr; //import sidewinderutil.Rotators; //import sidewinderutil.Cropcoords; //import sidewinderutil.IMGextensions; //import sidewinderutil.FlipInvert; // import java.awt.font.*; import java.awt.geom.*; import java.awt.FontMetrics; import java.awt.font.LineMetrics; import java.awt.GraphicsEnvironment; // class SidewinderPhotoColourBalancer extends javax.swing.JFrame implements java.awt.event.ActionListener,java.awt.event.ItemListener{ private final String[] uibuttext={"Up","Down","Up","Down","Up","Down","Up","Down","Open","Save"private final String[] uibuttcommand={"REDUP","REDDOWN","GREENUP","GREENDOWN","BLUEUP","BLUEDOWN","WHITEUP","WHITEDOWN","OPENFILE","SAVAS"private final java.awt.Color[] cols ={new Color(255,0,0),new Color(0,255,0),new Color(0,0,255),new Color(0,0,0),new Color(255,255,255)}; //JCheckBox chkwhtclbg; //static java.util.Iterator<javax.imageio.ImageWriter> iwrtRs; static javax.imageio.ImageIO ioStreamSyscalls2; //INNER CLASSES CANNOT HAVE STATIC DECLARATIONS static java.util.Iterator iwrtRs; //INNER CLASSES CANNOT HAVE STATIC DECLARATIONS RGBchangeCoeffLinear coloffl; // RGBchangeCoeffContrast coloffc; RGBchangeCoeffLinearSingle coloffs; RGBchangeCoeffLinearSingleHueSetter colHue; RGBchangeCoeffLinearGammaSetter rgbSetgamm; HueBoard hu; QuickBoardColour qbrd; FontTextBoard fontextbaud; // //JProgressBar wrkprog; //WorkBar wrkPROG; WorkWindowProgressor wrkprogess; WorkBar work; java.awt.Image sw32ico; // int alngPVal; java.util.Timer tm; Object wimg; // WritImgOutJPEG WritImgOutPNG WritImgOutBMP Frame dialFram; Splashframe splatter; // JButton bwbttn; // FchComp pfc; JPanel pl; // javax.swing.JSplitPane panesplit; javax.swing.JPanel labpan; java.awt.image.ImageObserver obsrvlab; javax.swing.JViewport[] panviewset; // javax.swing.JPanel[] panset; // javax.swing.JScrollPane[] panscro; // javax.swing.JTextArea metaPne; JButton[] colbutt; JCheckBox thumboo,thumbleep; DefaultComboBoxModel[] inpcombomodset; JComboBox[] inptnums; DefaultComboBoxModel szcombomod; JComboBox jox; int rsZidx; // combo index for resize int oldrsZidx; ImageWriteParam wrtPrm; JPanel toolpan,conslcntbtt; java.io.FileOutputStream foutstrm; //java.io.RandomAccessFile foutstrm; //java.io.File foutstrm; //javax.imageio.stream.FileImageOutputStream foutstrm; ConvertToBandW bnw; WritableRaster wras; MultiDimArr rgbDimArr; Rotators roTor; // roTor = new Rotators(bumi.getType()); //ThreadReduxPrior thePR; ThreadRedux1 the1; // = new ThreadRedux1(); ThreadRedux2 the2; ThreadRedux3 the3; //ThreadRedux2 theOther; // = new ThreadRedux2(e.getActionCommand()); actComm=e.getActionCommand() String actComm; String passPane; int imH; int lenw; short[][] red_Overstep; short[][] green_Overstep; short[][] blue_Overstep; // MULTI DIM INITS ImageSysTest imcanv; Graphics g; long tme = 50; ImWin tpn; Font uifont; JFileChooser flchs; JFrame parent; File inputimage; String curropendir; String currsavdir; //== error file if the error handler has a problem File errFil; // error file in su.dat PrintStream pr; // error printstram for stackTrace method ready String errF; int buttonjump=1; // JButton rdysz,mkrsz,quickclru,quickclrd,huebord; JTextField lngz,wzd,hzd; // JPanel[] bgbut; //javax.imageio.ImageWriter iwRT; javax.imageio.IIOParamController imPrmCnt; String app_Classpath_PATH,app_PATH,wnei; byte[] sysOS; String flsep; String linesep; boolean firstopenedis; boolean guiOpOccurring; // // thumb sizer panel JFrame thmbFrm; JPanel frmpanl; JLabel sett; JComboBox settLong; JButton setchoice; DefaultComboBoxModel thmsz; int szMkThmb; // // THUMB VIEWER JFrame thumbVIEW; JScrollPane vwscroll; JViewport cview; JPanel frmevwpnl; JPanel compvw; JLabel[] thmImgView; String thumbinf; // JPanel contain,containR,containL,contButtRow,crpWHlab,crpWHfields,crpXYfields,crpXYlab; JButton crpSet,crpClr,crpCrop,crpRccw,crpcw,crpRFror,crpRmror,crptxt; JTextField widefield,heightfield,xfield,yfield; JLabel wideLab,heightLab,xfieldLab,yfieldLab; java.util.Locale Aoriale; ComponentOrientation Acmpo; DefaultComboBoxModel omod; JComboBox crx; boolean cropsysstate; //BufferedImage copybumi; //Graphics g; Graphics gg; Rectangle rb; // NESTED READER CLASS PARTS static ImageIO ioStreamSyscalls; static java.util.Iterator imReaders; // java.util.Iterator imReaders // javax.imageio.stream.ImageInputStream imgInpStr; javax.imageio.ImageReader readIMG; javax.imageio.ImageReadParam rdrPRM; javax.imageio.IIOImage iioiMIG; BufferedImage bumi; Image bumiSZpaint; // javax.imageio.metadata.IIOMetadata imgIIOmtda; javax.imageio.metadata.IIOMetadata imgIIOmtdaRead; //org.w3c.dom.Node rootnod; //String mtdaTree; String imgfilename; File imgFiling; FileInputStream flimstrm; // http://www.oracle.com/technetwork/articles/javase/generics136597.html java.util.List imgThmbNl; // int numThumb; // String[] args; /* "180flip.png"," 0 blueminus.png"," 1 blueplus.png"," 2 cropclear.png"," 3 cropdo.png"," 4 cropset.png"," 5 doresize.png"," 6 gammapply.png"," 7 gammatry.png"," 8 greenminus.png"," 9 greenplus.png"," 10 hueboard.png"," 11 longside.png"," 12 mirror.png"," 13 open.png"," 14 quickboardminus.png"," 15 quickboardplus.png"," 16 redminus.png"," 17 redplus.png"," 18 rotateccw.png"," 19 rotatecw.png"," 20 saveas.png"," 21 textboard.png"," 22 textclear.png"," 23 textry2.png"," 24 textsize.png"," 25 toblackandwhite.png"," 26 whiteminus.png"," 27 whiteplus.png"}; 28 */ String icopath; String icoext; final String[] appicons ={"180flip","blueminus","blueplus","cropclear","cropdo","cropset","doresize","gammapply","gammatry","greenminus","greenplus","hueboard","longside","mirror","open","quickboardminus","quickboardplus","redminus","redplus","rotateccw","rotatecw","saveas","textboard","textclear","textry2","textsize","toblackandwhite","whiteminus","whiteplus"Image[] appiconsIMG; // CONSTRUCTOR FOLLOWS SidewinderPhotoColourBalancer(String[] args){ // takes a string arg from drag and drop on icon later // INSIDE CONSTRUCTOR this.args=args; // firstopenedis=false; cropsysstate=false; Aoriale =(java.util.Locale)Locale.US; //java.util.Locale Aoriale;ComponentOrientation Acmpo; Acmpo = ComponentOrientation.getOrientation(AorialesetComponentOrientation(Acmpotry{ flsep=System.getProperty("file.separator"linesep=System.getProperty("line.separator"curropendir = System.getProperty("user.home"currsavdir = System.getProperty("user.home"sysOS=(System.getProperty("os.name")).getBytes("ISO88591"wnei = new String(sysOS,0,sysOS.lengthapp_Classpath_PATH=System.getProperty("java.class.path"// if((wnei.equals("Windows XP"))||(wnei.equals("Windows NT"))||(wnei.equals("Windows 2000"))||(wnei.equals("Windows 98"))||(wnei.equals("Windows Me"))||(wnei.equals("Windows 2003"))||(wnei.equals("Windows_NT"))||(wnei.equals("Windows NT (unknown)"))||(wnei.equals("Windows Vista"))){ app_PATH=""+app_Classpath_PATH.substring(0,((int)app_Classpath_PATH.lastIndexOf((flsep+"engine")))); Page 1 / 32

Upload: samuel-alexander-marchant

Post on 13-Sep-2015

25 views

Category:

Documents


1 download

DESCRIPTION

Simple Photo Editor written in Java2 (Source Code) Version F2NOTE: BECAUSE OF THIS SITES READER, YOU NEED TO DOWNLOAD THE FILE TO BE ABLE TO READ(SEE) IT PROPERLY!USE AROUND 300% TO 400% VIEW SIZE IN ACROBAT.

TRANSCRIPT

  • /*THISistheF2Versionsomewherenearcompletedforrelease.Theoldsitewashttp://www.nicephotogjsp.netthenewsiteishttp://www.windsolarhybridaustralia.x10.mxThisapplicationisnotprincipleywritteninLinuxorWindowsandissometimesperversiononlyusableinoneortheotherOSsystem.ItisendevouredtobewrittenforbothandallWindowsandNIX'sOS'sintheonedownload...cdC:\SideWinderColourBalancer\engineFILENAMESHOULDBE"SideWinderPhotoColourBalancer.java"writtenbyMrSamuelAMarchantSydneyNSWAustraliaOctober20102015versionF2cdC:\SideWinderColourBalancer\engine\sidewinderutil"MultiDimArr.java"writtenbyMrSamuelAMarchantSydneyNSWAustraliaOctober2010"C:\ProgramFiles\Java\jdk1.5.0_07\bin\javac.exe"SidewinderPhotoColourBalancer.java"C:\ProgramFiles\Java\jdk1.5.0_07\bin\java.exe"classpath"C:\SideWinderColourBalancer\engine".SidewinderPhotoColourBalancer"C:\ProgramFiles\Java\jdk1.6.0_22\bin\javac.exe"SidewinderPhotoColourBalancer.java"C:\ProgramFiles\Java\jdk1.6.0_22\bin\java.exe"classpath"C:\SideWinderColourBalancer\engine".SidewinderPhotoColourBalancer*/import java.awt.*import java.awt.event.ActionListenerimport java.awt.event.ActionEventimport java.awt.Dimensionimport java.awt.image.*import javax.swing.event.*import java.awt.event.ItemEventimport java.awt.event.WindowAdapterimport java.awt.event.WindowEventimport javax.swing.*import javax.swing.filechooser.FileFilter//importjavax.swing.filechooser.FileNameExtensionFilterimport java.io.*import javax.imageio.*import javax.imageio.spi.*import javax.imageio.stream.*import javax.imageio.metadata.*//import java.util.*import java.util.Listimport java.util.Iterator//importsidewinderutil.*//importsidewinderutil.MultiDimArr//importsidewinderutil.Rotators//importsidewinderutil.Cropcoords//importsidewinderutil.IMGextensions//importsidewinderutil.FlipInvert//import java.awt.font.*import java.awt.geom.*import java.awt.FontMetricsimport java.awt.font.LineMetricsimport java.awt.GraphicsEnvironment//class SidewinderPhotoColourBalancer extends javax.swing.JFrame implements java.awt.event.ActionListener,java.awt.event.ItemListener{private final String[] uibuttext={"Up","Down","Up","Down","Up","Down","Up","Down","Open","Save"}private final String[] uibuttcommand={"REDUP","REDDOWN","GREENUP","GREENDOWN","BLUEUP","BLUEDOWN","WHITEUP","WHITEDOWN","OPENFILE","SAVAS"}private final java.awt.Color[] cols = {new Color(255,0,0),new Color(0,255,0),new Color(0,0,255),new Color(0,0,0),new Color(255,255,255)}//JCheckBoxchkwhtclbg//staticjava.util.IteratoriwrtRsstatic javax.imageio.ImageIO ioStreamSyscalls2 //INNERCLASSESCANNOTHAVESTATICDECLARATIONSstatic java.util.Iterator iwrtRs //INNERCLASSESCANNOTHAVESTATICDECLARATIONSRGBchangeCoeffLinear coloffl//RGBchangeCoeffContrastcoloffcRGBchangeCoeffLinearSingle coloffsRGBchangeCoeffLinearSingleHueSetter colHueRGBchangeCoeffLinearGammaSetter rgbSetgammHueBoard huQuickBoardColour qbrdFontTextBoard fontextbaud////JProgressBarwrkprog//WorkBarwrkPROGWorkWindowProgressor wrkprogessWorkBar workjava.awt.Image sw32ico//int alngPValjava.util.Timer tmObject wimg //WritImgOutJPEGWritImgOutPNGWritImgOutBMPFrame dialFramSplashframe splatter//JButton bwbttn//FchComp pfcJPanel pl//javax.swing.JSplitPane panesplitjavax.swing.JPanel labpanjava.awt.image.ImageObserver obsrvlabjavax.swing.JViewport[] panviewset //javax.swing.JPanel[] panset //javax.swing.JScrollPane[] panscro //javax.swing.JTextArea metaPneJButton[] colbuttJCheckBox thumboo,thumbleepDefaultComboBoxModel[] inpcombomodsetJComboBox[] inptnumsDefaultComboBoxModel szcombomodJComboBox joxint rsZidx //comboindexforresizeint oldrsZidxImageWriteParam wrtPrmJPanel toolpan,conslcntbttjava.io.FileOutputStream foutstrm//java.io.RandomAccessFilefoutstrm//java.io.Filefoutstrm//javax.imageio.stream.FileImageOutputStreamfoutstrmConvertToBandW bnwWritableRaster wrasMultiDimArr rgbDimArrRotators roTor //roTor=newRotators(bumi.getType())//ThreadReduxPriorthePRThreadRedux1 the1 //=newThreadRedux1()ThreadRedux2 the2ThreadRedux3 the3//ThreadRedux2theOther//=newThreadRedux2(e.getActionCommand())actComm=e.getActionCommand()String actCommString passPaneint imHint lenwshort[][] red_Overstepshort[][] green_Overstepshort[][] blue_Overstep//MULTIDIMINITSImageSysTest imcanvGraphics glong tme = 50ImWin tpnFont uifontJFileChooser flchsJFrame parentFile inputimageString curropendirString currsavdir//==errorfileiftheerrorhandlerhasaproblemFile errFil //errorfileinsu.datPrintStream pr //errorprintstramforstackTracemethodreadyString errFint buttonjump=1//

    JButton rdysz,mkrsz,quickclru,quickclrd,huebordJTextField lngz,wzd,hzd

    //JPanel[] bgbut//javax.imageio.ImageWriteriwRTjavax.imageio.IIOParamController imPrmCntString app_Classpath_PATH,app_PATH,wneibyte[] sysOSString flsepString linesepboolean firstopenedisboolean guiOpOccurring////thumbsizerpanelJFrame thmbFrmJPanel frmpanlJLabel settJComboBox settLongJButton setchoiceDefaultComboBoxModel thmszint szMkThmb////THUMBVIEWERJFrame thumbVIEWJScrollPane vwscrollJViewport cviewJPanel frmevwpnlJPanel compvwJLabel[] thmImgViewString thumbinf//JPanel contain,containR,containL,contButtRow,crpWHlab,crpWHfields,crpXYfields,crpXYlabJButton crpSet,crpClr,crpCrop,crpRccw,crpcw,crpRFror,crpRmror,crptxtJTextField widefield,heightfield,xfield,yfieldJLabel wideLab,heightLab,xfieldLab,yfieldLabjava.util.Locale AorialeComponentOrientation AcmpoDefaultComboBoxModel omodJComboBox crxboolean cropsysstate//BufferedImagecopybumi//GraphicsgGraphics ggRectangle rb//NESTEDREADERCLASSPARTSstatic ImageIO ioStreamSyscallsstatic java.util.Iterator imReaders //java.util.IteratorimReaders//javax.imageio.stream.ImageInputStream imgInpStrjavax.imageio.ImageReader readIMGjavax.imageio.ImageReadParam rdrPRMjavax.imageio.IIOImage iioiMIGBufferedImage bumiImage bumiSZpaint//javax.imageio.metadata.IIOMetadata imgIIOmtdajavax.imageio.metadata.IIOMetadata imgIIOmtdaRead//org.w3c.dom.Noderootnod//StringmtdaTreeString imgfilenameFile imgFilingFileInputStream flimstrm//http://www.oracle.com/technetwork/articles/javase/generics136597.htmljava.util.List imgThmbNl//int numThumb//String[] args/*"180flip.png","0blueminus.png","1blueplus.png","2cropclear.png","3cropdo.png","4cropset.png","5doresize.png","6gammapply.png","7gammatry.png","8greenminus.png","9greenplus.png","10hueboard.png","11longside.png","12mirror.png","13open.png","14quickboardminus.png","15quickboardplus.png","16redminus.png","17redplus.png","18rotateccw.png","19rotatecw.png","20saveas.png","21textboard.png","22textclear.png","23textry2.png","24textsize.png","25toblackandwhite.png","26whiteminus.png","27whiteplus.png"}28*/String icopathString icoextfinal String[] appicons = {"180flip","blueminus","blueplus","cropclear","cropdo","cropset","doresize","gammapply","gammatry","greenminus","greenplus","hueboard","longside","mirror","open","quickboardminus","quickboardplus","redminus","redplus","rotateccw","rotatecw","saveas","textboard","textclear","textry2","textsize","toblackandwhite","whiteminus","whiteplus"}Image[] appiconsIMG

    //CONSTRUCTORFOLLOWSSidewinderPhotoColourBalancer(String[] args){ //takesastringargfromdraganddroponiconlater//INSIDECONSTRUCTORthis.args=args//firstopenedis=falsecropsysstate=falseAoriale = (java.util.Locale)Locale.US //java.util.LocaleAorialeComponentOrientationAcmpoAcmpo = ComponentOrientation.getOrientation(Aoriale)setComponentOrientation(Acmpo)try{flsep=System.getProperty("file.separator")linesep=System.getProperty("line.separator")curropendir = System.getProperty("user.home")currsavdir = System.getProperty("user.home")sysOS=(System.getProperty("os.name")).getBytes("ISO88591")wnei = new String(sysOS,0,sysOS.length)app_Classpath_PATH=System.getProperty("java.class.path")//if((wnei.equals("WindowsXP"))||(wnei.equals("WindowsNT"))||(wnei.equals("Windows2000"))||(wnei.equals("Windows98"))||(wnei.equals("WindowsMe"))||(wnei.equals("Windows2003"))||(wnei.equals("Windows_NT"))||(wnei.equals("WindowsNT(unknown)"))||(wnei.equals("WindowsVista"))){app_PATH=""+app_Classpath_PATH.substring(0,((int)app_Classpath_PATH.lastIndexOf((flsep+"engine"))))icopath=app_PATH+flsep+"dat"+flsep+"sidewinder5050icons"+flsep+"ico"+flsepicoext=".gif"applicationIconMaker()}else{app_PATH=""+app_Classpath_PATH.substring(0,((int)app_Classpath_PATH.lastIndexOf(flsep+"engine")))icopath=app_PATH+flsep+"dat"+flsep+"sidewinder5050icons"+flsepicoext=".png" //req.tobe.giftestonlyapplicationIconMaker()}}catch(java.io.UnsupportedEncodingException unspenc){

    }finally{}//==instantiateerrorhandlerfortheerrorhandler(doublestageifthefirstfails)

    try{errF=app_PATH+flsep+"dat"+flsep+"errTraceSidewinder.txt"errFil=new File(errF)pr=new PrintStream(((OutputStream)new FileOutputStream(errFil,true)))//==//eiyti.printStackTrace(pr)}catch(java.io.FileNotFoundException fifterr){System.out.println("ConstructorEXCEPTION:java.io.FileNotFoundException"+errF+"ErrorhandlersystemdownSidewinderPhotoColourBalancer.java")}catch(java.lang.Exception excA){System.out.println("ConstructorEXCEPTION:java.lang.ExceptionErrorhandlersystemdownSidewinderPhotoColourBalancer.java")}finally{}

    try{String sw400pth = app_PATH+flsep+"dat"+flsep+"SidewinderA400.jpg"

    inputimage = new File(sw400pth)splatter = new Splashframe(sw400pth )uifont = ((Font)splatter.appfon) //,1,8)//(nopointing)originalwillsoonbeinanullclassimcanv = new ImageSysTest(inputimage) //GETSTHEIMAGE}catch(java.io.FileNotFoundException finotfn){finotfn.printStackTrace(pr)}catch(javax.imageio.IIOException imgioexc){imgioexc.printStackTrace(pr)}catch(java.io.IOException ioexconst){ioexconst.printStackTrace(pr)}catch(java.lang.Exception excafAS){stackExPasthru((Throwable)excafAS)}finally{}/*catch(java.io.IOExceptionioexconst){ioexconst.printStackTrace(pr)}*///rsZidx=0oldrsZidx=0//splatter.repaint(((long)newLong("10").longValue()))splatter.toFront()splatter.repaint()splatter.mssg="StartingSidewinder........"splatter.mssgPrs()//splatter.sidewindersplash.paintComponent(splatter.sidewindersplash.getGraphics())passPane=""bgbut = new JPanel[4] //WAS4NOW3bgbut[0] = new JPanel()bgbut[0].setPreferredSize(new Dimension(210,65))bgbut[0].setSize(new Dimension(210,65))bgbut[0].setLayout(new java.awt.FlowLayout(1,4,4))bgbut[0].setBackground(new Color(255,0,0))bgbut[1] = new JPanel()bgbut[1].setPreferredSize(new Dimension(210,65))bgbut[1].setSize(new Dimension(210,65))bgbut[1].setLayout(new java.awt.FlowLayout(1,4,4))bgbut[1].setBackground(new Color(0,255,0))bgbut[2] = new JPanel()bgbut[2].setPreferredSize(new Dimension(210,65))bgbut[2].setSize(new Dimension(210,65))bgbut[2].setLayout(new java.awt.FlowLayout(1,4,4))bgbut[2].setBackground(new Color(0,0,255))bgbut[3] = new JPanel()bgbut[3].setPreferredSize(new Dimension(210,65))bgbut[3].setSize(new Dimension(210,65))bgbut[3].setLayout(new java.awt.FlowLayout(1,4,4))bgbut[3].setBackground(new Color(255,255,255))//createButt()deledsplatter.toFront()splatter.repaint()splatter.mssg="Sidewinder:LoadingListGUIParts........"splatter.mssgPrs()szcombomod = new javax.swing.DefaultComboBoxModel()szcombomod.addElement((Object)"1/1")szcombomod.addElement((Object)"3/4")szcombomod.addElement((Object)"2/3")szcombomod.addElement((Object)"1/2")szcombomod.addElement((Object)"5/12")szcombomod.addElement((Object)"1/3")szcombomod.addElement((Object)"1/4")szcombomod.addElement((Object)"1/5") //szcombomod.addElement((Object)"3/16") //szcombomod.addElement((Object)"1/6") //szcombomod.addElement((Object)"1/8")szcombomod.addElement((Object)"1/10")szcombomod.addElement((Object)"1/12")szcombomod.addElement((Object)"1/16")jox = new JComboBox(szcombomod)jox.addItemListener(this)inpcombomodset = new javax.swing.DefaultComboBoxModel[4]for(int ckco=0(ckcohz){longside=true}

    float coef=0float lngz = new Integer(lsdz).floatValue()float hiz = new Integer(hz).floatValue()float wiz = new Integer(wz).floatValue()if(longside==true){ //"otherelse"istheheightcoef=lngz/wiz}else{//coef=lngz/hiz}float nht=coef*hizfloat nwd=coef*wizint wdin = (new Float(nwd).intValue())int hdin = (new Float(nht).intValue())//try{java.awt.Image bmiresiz = quickImg(wdin,hdin)BufferedImage bu = new BufferedImage(wdin,hdin,bumi.getType())Graphics gr=bu.getGraphics()gr.drawImage(bmiresiz,0,0,null)makeQuickBoard(bu,app_PATH,wdin,hdin,upordown)}catch(Exception exsxa){//System.out.println(exsxa.getMessage())exsxa.printStackTrace(pr)}finally{}}//enmeth

    void mcHue(){hu = new HueBoard(this) //WARNINGTESTPARAMETERSFEDONLY!!!!

    }//enmeth

    ////setValue()//repaint()

    void rotateCW(){work.makeParamWork(100) //swinder.bumi.getWidth()

    rotateSysClss() //newRotatorswork.setValue(10)work.repaint()//int bHI = bumi.getHeight()int bWI = bumi.getWidth()redCWRemake(bWI,bHI)//work.setValue(20)//work.repaint()//doGarbageClear()greenCWRemake(bWI,bHI)//work.setValue(30)//work.repaint()//doGarbageClear()blueCWRemake(bWI,bHI)//work.setValue(40)//work.repaint()//doGarbageClear()bmiMKrotate(bHI,bWI) //makesaCWrotatedbumi//work.setValue(50)//work.repaint()roTor = nullclearthumbL()doGarbageClear()//NOTICE(argumentsin!!!SP)FILLIN!!!MUSTBEDONEINHERErunthetranslatorpopulatormethodnextrotationPopulator(bHI,bWI)//work.setValue(70)////work.repaint()//nowsetSizesetIconrepaint//!!!!!!TPNMUSTBERESET"IN"HEREtpn.setIcon(new ImageIcon((java.awt.Image)bumi))tpn.setSize(new Dimension(bWI,bHI))tpn.repaint()//makeImgRsz(oldrsZidx)//work.setValue(100)//work.repaint()metaPne.append("===RotatedImage:==="+linesep)metaPne.append("===width:"+bumi.getWidth()+linesep)metaPne.append("===height:"+bumi.getHeight()+linesep)metaPne.append("===note:anypreviousthumnailsarecleared"+linesep)}//enmeth

    void rotateCCW(){rotateSysClss() //newRotatorsint bHI = bumi.getHeight()int bWI = bumi.getWidth()redCCWRemake(bWI,bHI)doGarbageClear()greenCCWRemake(bWI,bHI)doGarbageClear()blueCCWRemake(bWI,bHI)doGarbageClear()bmiMKrotate(bHI,bWI) //"swapstoH,Winsidethecallerfunction"makesaCCWrotatedbumiroTor = nullclearthumbL()doGarbageClear()////runthetranslatorpopulatormethodnextrotationPopulator(bHI,bWI)//nowsetSizesetIconrepaint//tpn.setIcon(newImageIcon((java.awt.Image)bumi))//tpn.setSize(newDimension(bWI,bHI))//tpn.repaint()makeImgRsz(oldrsZidx)metaPne.append("===RotatedImage:==="+linesep)metaPne.append("===width:"+bumi.getWidth()+linesep)metaPne.append("===height:"+bumi.getHeight()+linesep)metaPne.append("===note:anypreviousthumnailsarecleared"+linesep)}//enmeth

    public void actionPerformed(java.awt.event.ActionEvent e){actionComm(((String)e.getActionCommand()))//if(guiOpOccurring==false){guiOpOccurPresent(true)//JOptionPane.showMessageDialog(newJFrame(),"command(listenermethodsection):"+((String)e.getActionCommand()))try{oldrSzIdx(jox.getSelectedIndex()) //isalwayskeptbeforeabyassignmenttorSzIdx()//if(((boolean)actComm.equals("OPENFILE"))){passPane=""chooseOpenFile()if(firstopenedis==true){disnableButtons(true) //}//tpn.repaint()

    guiOpOccurPresent(false)//}else{int btyP=bumi.getType()if(((int)btyP==5) || ((int)btyP==4) || ((int)btyP==1)){ //normalRGBtruecolouroldrSzIdx(jox.getSelectedIndex()) //isalwayskeptbeforeabyassignmenttorSzIdx()if(((boolean)actComm.equals("THBOO"))&&((thumbleep.isSelected())==true)){thumbleep.setSelected(false)}else if(((boolean)actComm.equals("THBLEEP"))&&((thumboo.isSelected())==true)){thumboo.setSelected(false)}else if((boolean)actComm.equals("BLACKUNDWAAAHT")){disnableButtons(true)refreshBWmake()bnw.makeBWimage()rotationPopulator(bumi.getWidth(),bumi.getHeight())makeImgRsz(oldrsZidx)metaPne.append("===SwitchedImageToB&W==="+linesep)doGarbageClear()

    //JOptionPane.showMessageDialog(newJFrame(),"APPARRENTSEQUENCEFINNISHED???")//}else if(((boolean)actComm.equals("READYBMI"))){int wz=bumi.getWidth()int hz=bumi.getHeight()wzd.setText(new Integer(wz).toString())hzd.setText(new Integer(hz).toString())if(hz>wz){lngz.setText(hzd.getText())}else{lngz.setText(wzd.getText())}guiOpOccurPresent(false)disnableButtons(true)}else if(((boolean)actComm.equals("BMI"))){lngz.setEnabled(false) //onlylongsideboolean longside=falseint wz=bumi.getWidth()int hz=bumi.getHeight()wzd.setText(new Integer(wz).toString())hzd.setText(new Integer(hz).toString())if(wz>hz){longside=true}String aa=wzd.getText()String ab=hzd.getText()String ac=lngz.getText()//hzd.getText()//lngz.getText()boolean a1 = chKChr(aa)boolean a2 = chKChr(ab)boolean a3 = chKChr(ac)if((a1==true)&&(a2==true)&&(a3==true)){float coef=0float lngz = new Float(ac).floatValue()float hiz = new Float(ab).floatValue()float wiz = new Float(aa).floatValue()if(longside==true){ //"otherelse"istheheightcoef=lngz/wiz}else{//coef=lngz/hiz}float nht=coef*hizfloat nwd=coef*wizint wdin = (new Float(nwd).intValue())int hdin = (new Float(nht).intValue())//Image bmiresiz = bumi.getScaledInstance(wdin,hdin,4)bumi = new BufferedImage(wdin,hdin,bumi.getType())Graphics tr = bumi.getGraphics()tr.drawImage(bmiresiz,0,0,wdin,hdin,null)WritableRaster wras=bumi.getRaster()red_Overstep = rgbDimArr.colOverstepstore(0,hdin,wdin,wras)green_Overstep = rgbDimArr.colOverstepstore(1,hdin,wdin,wras)blue_Overstep = rgbDimArr.colOverstepstore(2,hdin,wdin,wras)tpn.setIcon(new ImageIcon((java.awt.Image)bumi))tpn.setSize(new Dimension(wdin,hdin))doGarbageClear()//POPULATORANDMULTIDIMMARTORESETUPAFTERRESIZINGPROCEDURE//rotationPopulator(bumi.getWidth(),bumi.getHeight())oldrSzIdx(0) //isalwayskeptbeforeabyassignmenttorSzIdx()makeImgRsz(0)jox.setSelectedIndex(0)metaPne.append("===ResizeofImageDone(previousaspectratio)==="+linesep)metaPne.append("::NewWidth:"+wdin+""+linesep)metaPne.append("::NewHeight:"+hdin+""+linesep)//RESTOREVIEWTOTHEjoxVIEWSELECTIONSETTING}else{JOptionPane.showMessageDialog(new JFrame(),"Onlynumbertobeusedastextentries!!")}//DOGARBAGECOLLECTIONHERElngz.setEnabled(true) //onlylongside//REENABLEBUTTONSFORGUIHEREguiOpOccurPresent(false)disnableButtons(true)}else if(((boolean)actComm.equals("SAVAS"))){chooseSaveAsFileLocation()guiOpOccurPresent(false)disnableButtons(true)}else if(((boolean)actComm.equals("SETTHUMBSZ"))){doSavesys() //"SETTHUMBSZ"isinthethumbimagelistenertrack}else if(((boolean)actComm.equals("SETCROP"))){if((cropsysstate==false)&&(((boolean)checkFieldCropval())==true)){doGarbageClear()//"setcrop"cropstater(true)oldrSzIdx(0) //isalwayskeptbeforeabyassignmenttorSzIdx()makeImgRsz(0)jox.setSelectedIndex(0)mkImCrpPaintSelect()doGarbageClear()}else{cropstater(false)JOptionPane.showMessageDialog(new JFrame(),"inputtypoerrorinatextentryfieldinputfieldvaluesmustbenumbers")}//enif

    disnableButtons(true)}else if(((boolean)actComm.equals("CLEARCROP"))){if(cropsysstate==true){tpn.cropIsOnflag(false)tpn.setIcon(new ImageIcon((java.awt.Image)bumi))tpn.repaint()rotationPopulator(bumi.getWidth(),bumi.getHeight())doGarbageClear()cropstater(false)//calltotpnforextraimagenulledandthendogarbagedoGarbageClear()}disnableButtons(true)}else if(((boolean)actComm.equals("DOCROP"))){if(cropsysstate==true){doGarbageClear()//if(checkFieldCropval()==true){ //!!!checkFieldCropval(excesscodethereareotherplaceshavethistestinternalbutishere//!!!topreventclasscastexceptionherecheckFieldCropval(int newide = new Integer(widefield.getText()).intValue()int newheight = new Integer(heightfield.getText()).intValue()doGarbageClear()rotateSysClss() //newRotatorsbmiMKrotate(newide,newheight) //roTor = nulldoGarbageClear()int topLpnt = new Integer(xfield.getText()).intValue()int topRpnt = new Integer(yfield.getText()).intValue()//makethenewmodifiedarraysfromtheoriginaloverstepsredCropRemake(topLpnt,topRpnt,newide,newheight)greenCropRemake(topLpnt,topRpnt,newide,newheight)blueCropRemake(topLpnt,topRpnt,newide,newheight)rotationPopulator(bumi.getWidth(),bumi.getHeight())/*TODOSETUPCOMPLETEREASSIGNINGOFiioIMAGEOBJECTSE.T.C.FORWRITEANDREFERENCESONbumi*/tpn.setSize(new Dimension(newide,newheight))tpn.setIcon(new ImageIcon(((Image)bumi)))tpn.repaint()oldrSzIdx(0) //isalwayskeptbeforeabyassignmenttorSzIdx()makeImgRsz(0)jox.setSelectedIndex(0)tpn.repaint()clearthumbL()//Stringcrppa=metaPne.getText()//metaPne.setText(crppa)String msgcrpping ="CropDone:Xpos:"+xfield.getText()+"::Ypos:"+ yfield.getText()+"::Width:"+ widefield.getText()+"::Height:"+heightfield.getText()metaPne.append("===CroppedImage:==="+linesep)metaPne.append(msgcrpping+linesep)metaPne.append("===width:"+bumi.getWidth()+linesep)metaPne.append("===height:"+bumi.getHeight()+linesep)metaPne.append("===note:anypreviousthumnailsarecleared"+linesep)//note:iioimagekeptformetadata}//enifcropstater(false)doGarbageClear()}//enifdisnableButtons(true)}else if(((boolean)actComm.equals("TEXTING"))){if(tpn.getTextFlag()==false){//stopdoublepanes//BOOLEANREQUIREDHERETOSWITCHOFFImWinselectionfontextbaud = new FontTextBoard(this)//metapaneappendisdonefromtextboardclass}disnableButtons(true)}else{//===================COMPOUNDEDthe1 = new ThreadRedux1()the1.start()//===================COMPOUNDED

    }//enlistenifels

    }//enelseforIMAGERESTRAINTS

    //}//enelseforopen

    //}catch(java.lang.IllegalThreadStateException thrupt1){stackExPasthru((Throwable)thrupt1)}catch(java.lang.Exception irexc1){stackExPasthru((Throwable)irexc1)}finally{}//guiOpOccurPresent(false)//if(oldrsZidx!=rsZidx){makeImgRsz(rsZidx)}else{makeImgRsz(oldrsZidx)}tpn.repaint()

    if(cropsysstate==true){//disnableButtons(false)crpRccw.setEnabled(false)crpcw.setEnabled(false)//!!!DONOTputguiOpOccurPresent(inhereif(oldrsZidx!=rsZidx){makeImgRsz(rsZidx)}else{makeImgRsz(oldrsZidx)}tpn.repaint()}else{crpRccw.setEnabled(true)crpcw.setEnabled(true)if(the1!=null){the1 = null}else{disLowerButs(true)}//eninnerifelsint bHI = bumi.getHeight()int bWI = bumi.getWidth()rotationPopulator(bWI,bHI)}//enifelsdoGarbageClear()}//enifguioccurend

    }//eneventmeth

    void rotationPopulator(int bumw,int bumhi){ //argsmaybereplacedWritableRaster bumras = bumi.getRaster()int caccr = 0//System.out.println("hibum:"+hibum+"wibum"+wibum+"bumw"+bumw+"bumhi"+bumhi)while(caccr

  • /*THISistheF2Versionsomewherenearcompletedforrelease.Theoldsitewashttp://www.nicephotogjsp.netthenewsiteishttp://www.windsolarhybridaustralia.x10.mxThisapplicationisnotprincipleywritteninLinuxorWindowsandissometimesperversiononlyusableinoneortheotherOSsystem.ItisendevouredtobewrittenforbothandallWindowsandNIX'sOS'sintheonedownload...cdC:\SideWinderColourBalancer\engineFILENAMESHOULDBE"SideWinderPhotoColourBalancer.java"writtenbyMrSamuelAMarchantSydneyNSWAustraliaOctober20102015versionF2cdC:\SideWinderColourBalancer\engine\sidewinderutil"MultiDimArr.java"writtenbyMrSamuelAMarchantSydneyNSWAustraliaOctober2010"C:\ProgramFiles\Java\jdk1.5.0_07\bin\javac.exe"SidewinderPhotoColourBalancer.java"C:\ProgramFiles\Java\jdk1.5.0_07\bin\java.exe"classpath"C:\SideWinderColourBalancer\engine".SidewinderPhotoColourBalancer"C:\ProgramFiles\Java\jdk1.6.0_22\bin\javac.exe"SidewinderPhotoColourBalancer.java"C:\ProgramFiles\Java\jdk1.6.0_22\bin\java.exe"classpath"C:\SideWinderColourBalancer\engine".SidewinderPhotoColourBalancer*/import java.awt.*import java.awt.event.ActionListenerimport java.awt.event.ActionEventimport java.awt.Dimensionimport java.awt.image.*import javax.swing.event.*import java.awt.event.ItemEventimport java.awt.event.WindowAdapterimport java.awt.event.WindowEventimport javax.swing.*import javax.swing.filechooser.FileFilter//importjavax.swing.filechooser.FileNameExtensionFilterimport java.io.*import javax.imageio.*import javax.imageio.spi.*import javax.imageio.stream.*import javax.imageio.metadata.*//import java.util.*import java.util.Listimport java.util.Iterator//importsidewinderutil.*//importsidewinderutil.MultiDimArr//importsidewinderutil.Rotators//importsidewinderutil.Cropcoords//importsidewinderutil.IMGextensions//importsidewinderutil.FlipInvert//import java.awt.font.*import java.awt.geom.*import java.awt.FontMetricsimport java.awt.font.LineMetricsimport java.awt.GraphicsEnvironment//class SidewinderPhotoColourBalancer extends javax.swing.JFrame implements java.awt.event.ActionListener,java.awt.event.ItemListener{private final String[] uibuttext={"Up","Down","Up","Down","Up","Down","Up","Down","Open","Save"}private final String[] uibuttcommand={"REDUP","REDDOWN","GREENUP","GREENDOWN","BLUEUP","BLUEDOWN","WHITEUP","WHITEDOWN","OPENFILE","SAVAS"}private final java.awt.Color[] cols = {new Color(255,0,0),new Color(0,255,0),new Color(0,0,255),new Color(0,0,0),new Color(255,255,255)}//JCheckBoxchkwhtclbg//staticjava.util.IteratoriwrtRsstatic javax.imageio.ImageIO ioStreamSyscalls2 //INNERCLASSESCANNOTHAVESTATICDECLARATIONSstatic java.util.Iterator iwrtRs //INNERCLASSESCANNOTHAVESTATICDECLARATIONSRGBchangeCoeffLinear coloffl//RGBchangeCoeffContrastcoloffcRGBchangeCoeffLinearSingle coloffsRGBchangeCoeffLinearSingleHueSetter colHueRGBchangeCoeffLinearGammaSetter rgbSetgammHueBoard huQuickBoardColour qbrdFontTextBoard fontextbaud////JProgressBarwrkprog//WorkBarwrkPROGWorkWindowProgressor wrkprogessWorkBar workjava.awt.Image sw32ico//int alngPValjava.util.Timer tmObject wimg //WritImgOutJPEGWritImgOutPNGWritImgOutBMPFrame dialFramSplashframe splatter//JButton bwbttn//FchComp pfcJPanel pl//javax.swing.JSplitPane panesplitjavax.swing.JPanel labpanjava.awt.image.ImageObserver obsrvlabjavax.swing.JViewport[] panviewset //javax.swing.JPanel[] panset //javax.swing.JScrollPane[] panscro //javax.swing.JTextArea metaPneJButton[] colbuttJCheckBox thumboo,thumbleepDefaultComboBoxModel[] inpcombomodsetJComboBox[] inptnumsDefaultComboBoxModel szcombomodJComboBox joxint rsZidx //comboindexforresizeint oldrsZidxImageWriteParam wrtPrmJPanel toolpan,conslcntbttjava.io.FileOutputStream foutstrm//java.io.RandomAccessFilefoutstrm//java.io.Filefoutstrm//javax.imageio.stream.FileImageOutputStreamfoutstrmConvertToBandW bnwWritableRaster wrasMultiDimArr rgbDimArrRotators roTor //roTor=newRotators(bumi.getType())//ThreadReduxPriorthePRThreadRedux1 the1 //=newThreadRedux1()ThreadRedux2 the2ThreadRedux3 the3//ThreadRedux2theOther//=newThreadRedux2(e.getActionCommand())actComm=e.getActionCommand()String actCommString passPaneint imHint lenwshort[][] red_Overstepshort[][] green_Overstepshort[][] blue_Overstep//MULTIDIMINITSImageSysTest imcanvGraphics glong tme = 50ImWin tpnFont uifontJFileChooser flchsJFrame parentFile inputimageString curropendirString currsavdir//==errorfileiftheerrorhandlerhasaproblemFile errFil //errorfileinsu.datPrintStream pr //errorprintstramforstackTracemethodreadyString errFint buttonjump=1//

    JButton rdysz,mkrsz,quickclru,quickclrd,huebordJTextField lngz,wzd,hzd

    //JPanel[] bgbut//javax.imageio.ImageWriteriwRTjavax.imageio.IIOParamController imPrmCntString app_Classpath_PATH,app_PATH,wneibyte[] sysOSString flsepString linesepboolean firstopenedisboolean guiOpOccurring////thumbsizerpanelJFrame thmbFrmJPanel frmpanlJLabel settJComboBox settLongJButton setchoiceDefaultComboBoxModel thmszint szMkThmb////THUMBVIEWERJFrame thumbVIEWJScrollPane vwscrollJViewport cviewJPanel frmevwpnlJPanel compvwJLabel[] thmImgViewString thumbinf//JPanel contain,containR,containL,contButtRow,crpWHlab,crpWHfields,crpXYfields,crpXYlabJButton crpSet,crpClr,crpCrop,crpRccw,crpcw,crpRFror,crpRmror,crptxtJTextField widefield,heightfield,xfield,yfieldJLabel wideLab,heightLab,xfieldLab,yfieldLabjava.util.Locale AorialeComponentOrientation AcmpoDefaultComboBoxModel omodJComboBox crxboolean cropsysstate//BufferedImagecopybumi//GraphicsgGraphics ggRectangle rb//NESTEDREADERCLASSPARTSstatic ImageIO ioStreamSyscallsstatic java.util.Iterator imReaders //java.util.IteratorimReaders//javax.imageio.stream.ImageInputStream imgInpStrjavax.imageio.ImageReader readIMGjavax.imageio.ImageReadParam rdrPRMjavax.imageio.IIOImage iioiMIGBufferedImage bumiImage bumiSZpaint//javax.imageio.metadata.IIOMetadata imgIIOmtdajavax.imageio.metadata.IIOMetadata imgIIOmtdaRead//org.w3c.dom.Noderootnod//StringmtdaTreeString imgfilenameFile imgFilingFileInputStream flimstrm//http://www.oracle.com/technetwork/articles/javase/generics136597.htmljava.util.List imgThmbNl//int numThumb//String[] args/*"180flip.png","0blueminus.png","1blueplus.png","2cropclear.png","3cropdo.png","4cropset.png","5doresize.png","6gammapply.png","7gammatry.png","8greenminus.png","9greenplus.png","10hueboard.png","11longside.png","12mirror.png","13open.png","14quickboardminus.png","15quickboardplus.png","16redminus.png","17redplus.png","18rotateccw.png","19rotatecw.png","20saveas.png","21textboard.png","22textclear.png","23textry2.png","24textsize.png","25toblackandwhite.png","26whiteminus.png","27whiteplus.png"}28*/String icopathString icoextfinal String[] appicons = {"180flip","blueminus","blueplus","cropclear","cropdo","cropset","doresize","gammapply","gammatry","greenminus","greenplus","hueboard","longside","mirror","open","quickboardminus","quickboardplus","redminus","redplus","rotateccw","rotatecw","saveas","textboard","textclear","textry2","textsize","toblackandwhite","whiteminus","whiteplus"}Image[] appiconsIMG

    //CONSTRUCTORFOLLOWSSidewinderPhotoColourBalancer(String[] args){ //takesastringargfromdraganddroponiconlater//INSIDECONSTRUCTORthis.args=args//firstopenedis=falsecropsysstate=falseAoriale = (java.util.Locale)Locale.US //java.util.LocaleAorialeComponentOrientationAcmpoAcmpo = ComponentOrientation.getOrientation(Aoriale)setComponentOrientation(Acmpo)try{flsep=System.getProperty("file.separator")linesep=System.getProperty("line.separator")curropendir = System.getProperty("user.home")currsavdir = System.getProperty("user.home")sysOS=(System.getProperty("os.name")).getBytes("ISO88591")wnei = new String(sysOS,0,sysOS.length)app_Classpath_PATH=System.getProperty("java.class.path")//if((wnei.equals("WindowsXP"))||(wnei.equals("WindowsNT"))||(wnei.equals("Windows2000"))||(wnei.equals("Windows98"))||(wnei.equals("WindowsMe"))||(wnei.equals("Windows2003"))||(wnei.equals("Windows_NT"))||(wnei.equals("WindowsNT(unknown)"))||(wnei.equals("WindowsVista"))){app_PATH=""+app_Classpath_PATH.substring(0,((int)app_Classpath_PATH.lastIndexOf((flsep+"engine"))))icopath=app_PATH+flsep+"dat"+flsep+"sidewinder5050icons"+flsep+"ico"+flsepicoext=".gif"applicationIconMaker()}else{app_PATH=""+app_Classpath_PATH.substring(0,((int)app_Classpath_PATH.lastIndexOf(flsep+"engine")))icopath=app_PATH+flsep+"dat"+flsep+"sidewinder5050icons"+flsepicoext=".png" //req.tobe.giftestonlyapplicationIconMaker()}}catch(java.io.UnsupportedEncodingException unspenc){

    }finally{}//==instantiateerrorhandlerfortheerrorhandler(doublestageifthefirstfails)

    try{errF=app_PATH+flsep+"dat"+flsep+"errTraceSidewinder.txt"errFil=new File(errF)pr=new PrintStream(((OutputStream)new FileOutputStream(errFil,true)))//==//eiyti.printStackTrace(pr)}catch(java.io.FileNotFoundException fifterr){System.out.println("ConstructorEXCEPTION:java.io.FileNotFoundException"+errF+"ErrorhandlersystemdownSidewinderPhotoColourBalancer.java")}catch(java.lang.Exception excA){System.out.println("ConstructorEXCEPTION:java.lang.ExceptionErrorhandlersystemdownSidewinderPhotoColourBalancer.java")}finally{}

    try{String sw400pth = app_PATH+flsep+"dat"+flsep+"SidewinderA400.jpg"

    inputimage = new File(sw400pth)splatter = new Splashframe(sw400pth )uifont = ((Font)splatter.appfon) //,1,8)//(nopointing)originalwillsoonbeinanullclassimcanv = new ImageSysTest(inputimage) //GETSTHEIMAGE}catch(java.io.FileNotFoundException finotfn){finotfn.printStackTrace(pr)}catch(javax.imageio.IIOException imgioexc){imgioexc.printStackTrace(pr)}catch(java.io.IOException ioexconst){ioexconst.printStackTrace(pr)}catch(java.lang.Exception excafAS){stackExPasthru((Throwable)excafAS)}finally{}/*catch(java.io.IOExceptionioexconst){ioexconst.printStackTrace(pr)}*///rsZidx=0oldrsZidx=0//splatter.repaint(((long)newLong("10").longValue()))splatter.toFront()splatter.repaint()splatter.mssg="StartingSidewinder........"splatter.mssgPrs()//splatter.sidewindersplash.paintComponent(splatter.sidewindersplash.getGraphics())passPane=""bgbut = new JPanel[4] //WAS4NOW3bgbut[0] = new JPanel()bgbut[0].setPreferredSize(new Dimension(210,65))bgbut[0].setSize(new Dimension(210,65))bgbut[0].setLayout(new java.awt.FlowLayout(1,4,4))bgbut[0].setBackground(new Color(255,0,0))bgbut[1] = new JPanel()bgbut[1].setPreferredSize(new Dimension(210,65))bgbut[1].setSize(new Dimension(210,65))bgbut[1].setLayout(new java.awt.FlowLayout(1,4,4))bgbut[1].setBackground(new Color(0,255,0))bgbut[2] = new JPanel()bgbut[2].setPreferredSize(new Dimension(210,65))bgbut[2].setSize(new Dimension(210,65))bgbut[2].setLayout(new java.awt.FlowLayout(1,4,4))bgbut[2].setBackground(new Color(0,0,255))bgbut[3] = new JPanel()bgbut[3].setPreferredSize(new Dimension(210,65))bgbut[3].setSize(new Dimension(210,65))bgbut[3].setLayout(new java.awt.FlowLayout(1,4,4))bgbut[3].setBackground(new Color(255,255,255))//createButt()deledsplatter.toFront()splatter.repaint()splatter.mssg="Sidewinder:LoadingListGUIParts........"splatter.mssgPrs()szcombomod = new javax.swing.DefaultComboBoxModel()szcombomod.addElement((Object)"1/1")szcombomod.addElement((Object)"3/4")szcombomod.addElement((Object)"2/3")szcombomod.addElement((Object)"1/2")szcombomod.addElement((Object)"5/12")szcombomod.addElement((Object)"1/3")szcombomod.addElement((Object)"1/4")szcombomod.addElement((Object)"1/5") //szcombomod.addElement((Object)"3/16") //szcombomod.addElement((Object)"1/6") //szcombomod.addElement((Object)"1/8")szcombomod.addElement((Object)"1/10")szcombomod.addElement((Object)"1/12")szcombomod.addElement((Object)"1/16")jox = new JComboBox(szcombomod)jox.addItemListener(this)inpcombomodset = new javax.swing.DefaultComboBoxModel[4]for(int ckco=0(ckcohz){longside=true}

    float coef=0float lngz = new Integer(lsdz).floatValue()float hiz = new Integer(hz).floatValue()float wiz = new Integer(wz).floatValue()if(longside==true){ //"otherelse"istheheightcoef=lngz/wiz}else{//coef=lngz/hiz}float nht=coef*hizfloat nwd=coef*wizint wdin = (new Float(nwd).intValue())int hdin = (new Float(nht).intValue())//try{java.awt.Image bmiresiz = quickImg(wdin,hdin)BufferedImage bu = new BufferedImage(wdin,hdin,bumi.getType())Graphics gr=bu.getGraphics()gr.drawImage(bmiresiz,0,0,null)makeQuickBoard(bu,app_PATH,wdin,hdin,upordown)}catch(Exception exsxa){//System.out.println(exsxa.getMessage())exsxa.printStackTrace(pr)}finally{}}//enmeth

    void mcHue(){hu = new HueBoard(this) //WARNINGTESTPARAMETERSFEDONLY!!!!

    }//enmeth

    ////setValue()//repaint()

    void rotateCW(){work.makeParamWork(100) //swinder.bumi.getWidth()

    rotateSysClss() //newRotatorswork.setValue(10)work.repaint()//int bHI = bumi.getHeight()int bWI = bumi.getWidth()redCWRemake(bWI,bHI)//work.setValue(20)//work.repaint()//doGarbageClear()greenCWRemake(bWI,bHI)//work.setValue(30)//work.repaint()//doGarbageClear()blueCWRemake(bWI,bHI)//work.setValue(40)//work.repaint()//doGarbageClear()bmiMKrotate(bHI,bWI) //makesaCWrotatedbumi//work.setValue(50)//work.repaint()roTor = nullclearthumbL()doGarbageClear()//NOTICE(argumentsin!!!SP)FILLIN!!!MUSTBEDONEINHERErunthetranslatorpopulatormethodnextrotationPopulator(bHI,bWI)//work.setValue(70)////work.repaint()//nowsetSizesetIconrepaint//!!!!!!TPNMUSTBERESET"IN"HEREtpn.setIcon(new ImageIcon((java.awt.Image)bumi))tpn.setSize(new Dimension(bWI,bHI))tpn.repaint()//makeImgRsz(oldrsZidx)//work.setValue(100)//work.repaint()metaPne.append("===RotatedImage:==="+linesep)metaPne.append("===width:"+bumi.getWidth()+linesep)metaPne.append("===height:"+bumi.getHeight()+linesep)metaPne.append("===note:anypreviousthumnailsarecleared"+linesep)}//enmeth

    void rotateCCW(){rotateSysClss() //newRotatorsint bHI = bumi.getHeight()int bWI = bumi.getWidth()redCCWRemake(bWI,bHI)doGarbageClear()greenCCWRemake(bWI,bHI)doGarbageClear()blueCCWRemake(bWI,bHI)doGarbageClear()bmiMKrotate(bHI,bWI) //"swapstoH,Winsidethecallerfunction"makesaCCWrotatedbumiroTor = nullclearthumbL()doGarbageClear()////runthetranslatorpopulatormethodnextrotationPopulator(bHI,bWI)//nowsetSizesetIconrepaint//tpn.setIcon(newImageIcon((java.awt.Image)bumi))//tpn.setSize(newDimension(bWI,bHI))//tpn.repaint()makeImgRsz(oldrsZidx)metaPne.append("===RotatedImage:==="+linesep)metaPne.append("===width:"+bumi.getWidth()+linesep)metaPne.append("===height:"+bumi.getHeight()+linesep)metaPne.append("===note:anypreviousthumnailsarecleared"+linesep)}//enmeth

    public void actionPerformed(java.awt.event.ActionEvent e){actionComm(((String)e.getActionCommand()))//if(guiOpOccurring==false){guiOpOccurPresent(true)//JOptionPane.showMessageDialog(newJFrame(),"command(listenermethodsection):"+((String)e.getActionCommand()))try{oldrSzIdx(jox.getSelectedIndex()) //isalwayskeptbeforeabyassignmenttorSzIdx()//if(((boolean)actComm.equals("OPENFILE"))){passPane=""chooseOpenFile()if(firstopenedis==true){disnableButtons(true) //}//tpn.repaint()

    guiOpOccurPresent(false)//}else{int btyP=bumi.getType()if(((int)btyP==5) || ((int)btyP==4) || ((int)btyP==1)){ //normalRGBtruecolouroldrSzIdx(jox.getSelectedIndex()) //isalwayskeptbeforeabyassignmenttorSzIdx()if(((boolean)actComm.equals("THBOO"))&&((thumbleep.isSelected())==true)){thumbleep.setSelected(false)}else if(((boolean)actComm.equals("THBLEEP"))&&((thumboo.isSelected())==true)){thumboo.setSelected(false)}else if((boolean)actComm.equals("BLACKUNDWAAAHT")){disnableButtons(true)refreshBWmake()bnw.makeBWimage()rotationPopulator(bumi.getWidth(),bumi.getHeight())makeImgRsz(oldrsZidx)metaPne.append("===SwitchedImageToB&W==="+linesep)doGarbageClear()

    //JOptionPane.showMessageDialog(newJFrame(),"APPARRENTSEQUENCEFINNISHED???")//}else if(((boolean)actComm.equals("READYBMI"))){int wz=bumi.getWidth()int hz=bumi.getHeight()wzd.setText(new Integer(wz).toString())hzd.setText(new Integer(hz).toString())if(hz>wz){lngz.setText(hzd.getText())}else{lngz.setText(wzd.getText())}guiOpOccurPresent(false)disnableButtons(true)}else if(((boolean)actComm.equals("BMI"))){lngz.setEnabled(false) //onlylongsideboolean longside=falseint wz=bumi.getWidth()int hz=bumi.getHeight()wzd.setText(new Integer(wz).toString())hzd.setText(new Integer(hz).toString())if(wz>hz){longside=true}String aa=wzd.getText()String ab=hzd.getText()String ac=lngz.getText()//hzd.getText()//lngz.getText()boolean a1 = chKChr(aa)boolean a2 = chKChr(ab)boolean a3 = chKChr(ac)if((a1==true)&&(a2==true)&&(a3==true)){float coef=0float lngz = new Float(ac).floatValue()float hiz = new Float(ab).floatValue()float wiz = new Float(aa).floatValue()if(longside==true){ //"otherelse"istheheightcoef=lngz/wiz}else{//coef=lngz/hiz}float nht=coef*hizfloat nwd=coef*wizint wdin = (new Float(nwd).intValue())int hdin = (new Float(nht).intValue())//Image bmiresiz = bumi.getScaledInstance(wdin,hdin,4)bumi = new BufferedImage(wdin,hdin,bumi.getType())Graphics tr = bumi.getGraphics()tr.drawImage(bmiresiz,0,0,wdin,hdin,null)WritableRaster wras=bumi.getRaster()red_Overstep = rgbDimArr.colOverstepstore(0,hdin,wdin,wras)green_Overstep = rgbDimArr.colOverstepstore(1,hdin,wdin,wras)blue_Overstep = rgbDimArr.colOverstepstore(2,hdin,wdin,wras)tpn.setIcon(new ImageIcon((java.awt.Image)bumi))tpn.setSize(new Dimension(wdin,hdin))doGarbageClear()//POPULATORANDMULTIDIMMARTORESETUPAFTERRESIZINGPROCEDURE//rotationPopulator(bumi.getWidth(),bumi.getHeight())oldrSzIdx(0) //isalwayskeptbeforeabyassignmenttorSzIdx()makeImgRsz(0)jox.setSelectedIndex(0)metaPne.append("===ResizeofImageDone(previousaspectratio)==="+linesep)metaPne.append("::NewWidth:"+wdin+""+linesep)metaPne.append("::NewHeight:"+hdin+""+linesep)//RESTOREVIEWTOTHEjoxVIEWSELECTIONSETTING}else{JOptionPane.showMessageDialog(new JFrame(),"Onlynumbertobeusedastextentries!!")}//DOGARBAGECOLLECTIONHERElngz.setEnabled(true) //onlylongside//REENABLEBUTTONSFORGUIHEREguiOpOccurPresent(false)disnableButtons(true)}else if(((boolean)actComm.equals("SAVAS"))){chooseSaveAsFileLocation()guiOpOccurPresent(false)disnableButtons(true)}else if(((boolean)actComm.equals("SETTHUMBSZ"))){doSavesys() //"SETTHUMBSZ"isinthethumbimagelistenertrack}else if(((boolean)actComm.equals("SETCROP"))){if((cropsysstate==false)&&(((boolean)checkFieldCropval())==true)){doGarbageClear()//"setcrop"cropstater(true)oldrSzIdx(0) //isalwayskeptbeforeabyassignmenttorSzIdx()makeImgRsz(0)jox.setSelectedIndex(0)mkImCrpPaintSelect()doGarbageClear()}else{cropstater(false)JOptionPane.showMessageDialog(new JFrame(),"inputtypoerrorinatextentryfieldinputfieldvaluesmustbenumbers")}//enif

    disnableButtons(true)}else if(((boolean)actComm.equals("CLEARCROP"))){if(cropsysstate==true){tpn.cropIsOnflag(false)tpn.setIcon(new ImageIcon((java.awt.Image)bumi))tpn.repaint()rotationPopulator(bumi.getWidth(),bumi.getHeight())doGarbageClear()cropstater(false)//calltotpnforextraimagenulledandthendogarbagedoGarbageClear()}disnableButtons(true)}else if(((boolean)actComm.equals("DOCROP"))){if(cropsysstate==true){doGarbageClear()//if(checkFieldCropval()==true){ //!!!checkFieldCropval(excesscodethereareotherplaceshavethistestinternalbutishere//!!!topreventclasscastexceptionherecheckFieldCropval(int newide = new Integer(widefield.getText()).intValue()int newheight = new Integer(heightfield.getText()).intValue()doGarbageClear()rotateSysClss() //newRotatorsbmiMKrotate(newide,newheight) //roTor = nulldoGarbageClear()int topLpnt = new Integer(xfield.getText()).intValue()int topRpnt = new Integer(yfield.getText()).intValue()//makethenewmodifiedarraysfromtheoriginaloverstepsredCropRemake(topLpnt,topRpnt,newide,newheight)greenCropRemake(topLpnt,topRpnt,newide,newheight)blueCropRemake(topLpnt,topRpnt,newide,newheight)rotationPopulator(bumi.getWidth(),bumi.getHeight())/*TODOSETUPCOMPLETEREASSIGNINGOFiioIMAGEOBJECTSE.T.C.FORWRITEANDREFERENCESONbumi*/tpn.setSize(new Dimension(newide,newheight))tpn.setIcon(new ImageIcon(((Image)bumi)))tpn.repaint()oldrSzIdx(0) //isalwayskeptbeforeabyassignmenttorSzIdx()makeImgRsz(0)jox.setSelectedIndex(0)tpn.repaint()clearthumbL()//Stringcrppa=metaPne.getText()//metaPne.setText(crppa)String msgcrpping ="CropDone:Xpos:"+xfield.getText()+"::Ypos:"+ yfield.getText()+"::Width:"+ widefield.getText()+"::Height:"+heightfield.getText()metaPne.append("===CroppedImage:==="+linesep)metaPne.append(msgcrpping+linesep)metaPne.append("===width:"+bumi.getWidth()+linesep)metaPne.append("===height:"+bumi.getHeight()+linesep)metaPne.append("===note:anypreviousthumnailsarecleared"+linesep)//note:iioimagekeptformetadata}//enifcropstater(false)doGarbageClear()}//enifdisnableButtons(true)}else if(((boolean)actComm.equals("TEXTING"))){if(tpn.getTextFlag()==false){//stopdoublepanes//BOOLEANREQUIREDHERETOSWITCHOFFImWinselectionfontextbaud = new FontTextBoard(this)//metapaneappendisdonefromtextboardclass}disnableButtons(true)}else{//===================COMPOUNDEDthe1 = new ThreadRedux1()the1.start()//===================COMPOUNDED

    }//enlistenifels

    }//enelseforIMAGERESTRAINTS

    //}//enelseforopen

    //}catch(java.lang.IllegalThreadStateException thrupt1){stackExPasthru((Throwable)thrupt1)}catch(java.lang.Exception irexc1){stackExPasthru((Throwable)irexc1)}finally{}//guiOpOccurPresent(false)//if(oldrsZidx!=rsZidx){makeImgRsz(rsZidx)}else{makeImgRsz(oldrsZidx)}tpn.repaint()

    if(cropsysstate==true){//disnableButtons(false)crpRccw.setEnabled(false)crpcw.setEnabled(false)//!!!DONOTputguiOpOccurPresent(inhereif(oldrsZidx!=rsZidx){makeImgRsz(rsZidx)}else{makeImgRsz(oldrsZidx)}tpn.repaint()}else{crpRccw.setEnabled(true)crpcw.setEnabled(true)if(the1!=null){the1 = null}else{disLowerButs(true)}//eninnerifelsint bHI = bumi.getHeight()int bWI = bumi.getWidth()rotationPopulator(bWI,bHI)}//enifelsdoGarbageClear()}//enifguioccurend

    }//eneventmeth

    void rotationPopulator(int bumw,int bumhi){ //argsmaybereplacedWritableRaster bumras = bumi.getRaster()int caccr = 0//System.out.println("hibum:"+hibum+"wibum"+wibum+"bumw"+bumw+"bumhi"+bumhi)while(caccr

  • /*THISistheF2Versionsomewherenearcompletedforrelease.Theoldsitewashttp://www.nicephotogjsp.netthenewsiteishttp://www.windsolarhybridaustralia.x10.mxThisapplicationisnotprincipleywritteninLinuxorWindowsandissometimesperversiononlyusableinoneortheotherOSsystem.ItisendevouredtobewrittenforbothandallWindowsandNIX'sOS'sintheonedownload...cdC:\SideWinderColourBalancer\engineFILENAMESHOULDBE"SideWinderPhotoColourBalancer.java"writtenbyMrSamuelAMarchantSydneyNSWAustraliaOctober20102015versionF2cdC:\SideWinderColourBalancer\engine\sidewinderutil"MultiDimArr.java"writtenbyMrSamuelAMarchantSydneyNSWAustraliaOctober2010"C:\ProgramFiles\Java\jdk1.5.0_07\bin\javac.exe"SidewinderPhotoColourBalancer.java"C:\ProgramFiles\Java\jdk1.5.0_07\bin\java.exe"classpath"C:\SideWinderColourBalancer\engine".SidewinderPhotoColourBalancer"C:\ProgramFiles\Java\jdk1.6.0_22\bin\javac.exe"SidewinderPhotoColourBalancer.java"C:\ProgramFiles\Java\jdk1.6.0_22\bin\java.exe"classpath"C:\SideWinderColourBalancer\engine".SidewinderPhotoColourBalancer*/import java.awt.*import java.awt.event.ActionListenerimport java.awt.event.ActionEventimport java.awt.Dimensionimport java.awt.image.*import javax.swing.event.*import java.awt.event.ItemEventimport java.awt.event.WindowAdapterimport java.awt.event.WindowEventimport javax.swing.*import javax.swing.filechooser.FileFilter//importjavax.swing.filechooser.FileNameExtensionFilterimport java.io.*import javax.imageio.*import javax.imageio.spi.*import javax.imageio.stream.*import javax.imageio.metadata.*//import java.util.*import java.util.Listimport java.util.Iterator//importsidewinderutil.*//importsidewinderutil.MultiDimArr//importsidewinderutil.Rotators//importsidewinderutil.Cropcoords//importsidewinderutil.IMGextensions//importsidewinderutil.FlipInvert//import java.awt.font.*import java.awt.geom.*import java.awt.FontMetricsimport java.awt.font.LineMetricsimport java.awt.GraphicsEnvironment//class SidewinderPhotoColourBalancer extends javax.swing.JFrame implements java.awt.event.ActionListener,java.awt.event.ItemListener{private final String[] uibuttext={"Up","Down","Up","Down","Up","Down","Up","Down","Open","Save"}private final String[] uibuttcommand={"REDUP","REDDOWN","GREENUP","GREENDOWN","BLUEUP","BLUEDOWN","WHITEUP","WHITEDOWN","OPENFILE","SAVAS"}private final java.awt.Color[] cols = {new Color(255,0,0),new Color(0,255,0),new Color(0,0,255),new Color(0,0,0),new Color(255,255,255)}//JCheckBoxchkwhtclbg//staticjava.util.IteratoriwrtRsstatic javax.imageio.ImageIO ioStreamSyscalls2 //INNERCLASSESCANNOTHAVESTATICDECLARATIONSstatic java.util.Iterator iwrtRs //INNERCLASSESCANNOTHAVESTATICDECLARATIONSRGBchangeCoeffLinear coloffl//RGBchangeCoeffContrastcoloffcRGBchangeCoeffLinearSingle coloffsRGBchangeCoeffLinearSingleHueSetter colHueRGBchangeCoeffLinearGammaSetter rgbSetgammHueBoard huQuickBoardColour qbrdFontTextBoard fontextbaud////JProgressBarwrkprog//WorkBarwrkPROGWorkWindowProgressor wrkprogessWorkBar workjava.awt.Image sw32ico//int alngPValjava.util.Timer tmObject wimg //WritImgOutJPEGWritImgOutPNGWritImgOutBMPFrame dialFramSplashframe splatter//JButton bwbttn//FchComp pfcJPanel pl//javax.swing.JSplitPane panesplitjavax.swing.JPanel labpanjava.awt.image.ImageObserver obsrvlabjavax.swing.JViewport[] panviewset //javax.swing.JPanel[] panset //javax.swing.JScrollPane[] panscro //javax.swing.JTextArea metaPneJButton[] colbuttJCheckBox thumboo,thumbleepDefaultComboBoxModel[] inpcombomodsetJComboBox[] inptnumsDefaultComboBoxModel szcombomodJComboBox joxint rsZidx //comboindexforresizeint oldrsZidxImageWriteParam wrtPrmJPanel toolpan,conslcntbttjava.io.FileOutputStream foutstrm//java.io.RandomAccessFilefoutstrm//java.io.Filefoutstrm//javax.imageio.stream.FileImageOutputStreamfoutstrmConvertToBandW bnwWritableRaster wrasMultiDimArr rgbDimArrRotators roTor //roTor=newRotators(bumi.getType())//ThreadReduxPriorthePRThreadRedux1 the1 //=newThreadRedux1()ThreadRedux2 the2ThreadRedux3 the3//ThreadRedux2theOther//=newThreadRedux2(e.getActionCommand())actComm=e.getActionCommand()String actCommString passPaneint imHint lenwshort[][] red_Overstepshort[][] green_Overstepshort[][] blue_Overstep//MULTIDIMINITSImageSysTest imcanvGraphics glong tme = 50ImWin tpnFont uifontJFileChooser flchsJFrame parentFile inputimageString curropendirString currsavdir//==errorfileiftheerrorhandlerhasaproblemFile errFil //errorfileinsu.datPrintStream pr //errorprintstramforstackTracemethodreadyString errFint buttonjump=1//

    JButton rdysz,mkrsz,quickclru,quickclrd,huebordJTextField lngz,wzd,hzd

    //JPanel[] bgbut//javax.imageio.ImageWriteriwRTjavax.imageio.IIOParamController imPrmCntString app_Classpath_PATH,app_PATH,wneibyte[] sysOSString flsepString linesepboolean firstopenedisboolean guiOpOccurring////thumbsizerpanelJFrame thmbFrmJPanel frmpanlJLabel settJComboBox settLongJButton setchoiceDefaultComboBoxModel thmszint szMkThmb////THUMBVIEWERJFrame thumbVIEWJScrollPane vwscrollJViewport cviewJPanel frmevwpnlJPanel compvwJLabel[] thmImgViewString thumbinf//JPanel contain,containR,containL,contButtRow,crpWHlab,crpWHfields,crpXYfields,crpXYlabJButton crpSet,crpClr,crpCrop,crpRccw,crpcw,crpRFror,crpRmror,crptxtJTextField widefield,heightfield,xfield,yfieldJLabel wideLab,heightLab,xfieldLab,yfieldLabjava.util.Locale AorialeComponentOrientation AcmpoDefaultComboBoxModel omodJComboBox crxboolean cropsysstate//BufferedImagecopybumi//GraphicsgGraphics ggRectangle rb//NESTEDREADERCLASSPARTSstatic ImageIO ioStreamSyscallsstatic java.util.Iterator imReaders //java.util.IteratorimReaders//javax.imageio.stream.ImageInputStream imgInpStrjavax.imageio.ImageReader readIMGjavax.imageio.ImageReadParam rdrPRMjavax.imageio.IIOImage iioiMIGBufferedImage bumiImage bumiSZpaint//javax.imageio.metadata.IIOMetadata imgIIOmtdajavax.imageio.metadata.IIOMetadata imgIIOmtdaRead//org.w3c.dom.Noderootnod//StringmtdaTreeString imgfilenameFile imgFilingFileInputStream flimstrm//http://www.oracle.com/technetwork/articles/javase/generics136597.htmljava.util.List imgThmbNl//int numThumb//String[] args/*"180flip.png","0blueminus.png","1blueplus.png","2cropclear.png","3cropdo.png","4cropset.png","5doresize.png","6gammapply.png","7gammatry.png","8greenminus.png","9greenplus.png","10hueboard.png","11longside.png","12mirror.png","13open.png","14quickboardminus.png","15quickboardplus.png","16redminus.png","17redplus.png","18rotateccw.png","19rotatecw.png","20saveas.png","21textboard.png","22textclear.png","23textry2.png","24textsize.png","25toblackandwhite.png","26whiteminus.png","27whiteplus.png"}28*/String icopathString icoextfinal String[] appicons = {"180flip","blueminus","blueplus","cropclear","cropdo","cropset","doresize","gammapply","gammatry","greenminus","greenplus","hueboard","longside","mirror","open","quickboardminus","quickboardplus","redminus","redplus","rotateccw","rotatecw","saveas","textboard","textclear","textry2","textsize","toblackandwhite","whiteminus","whiteplus"}Image[] appiconsIMG

    //CONSTRUCTORFOLLOWSSidewinderPhotoColourBalancer(String[] args){ //takesastringargfromdraganddroponiconlater//INSIDECONSTRUCTORthis.args=args//firstopenedis=falsecropsysstate=falseAoriale = (java.util.Locale)Locale.US //java.util.LocaleAorialeComponentOrientationAcmpoAcmpo = ComponentOrientation.getOrientation(Aoriale)setComponentOrientation(Acmpo)try{flsep=System.getProperty("file.separator")linesep=System.getProperty("line.separator")curropendir = System.getProperty("user.home")currsavdir = System.getProperty("user.home")sysOS=(System.getProperty("os.name")).getBytes("ISO88591")wnei = new String(sysOS,0,sysOS.length)app_Classpath_PATH=System.getProperty("java.class.path")//if((wnei.equals("WindowsXP"))||(wnei.equals("WindowsNT"))||(wnei.equals("Windows2000"))||(wnei.equals("Windows98"))||(wnei.equals("WindowsMe"))||(wnei.equals("Windows2003"))||(wnei.equals("Windows_NT"))||(wnei.equals("WindowsNT(unknown)"))||(wnei.equals("WindowsVista"))){app_PATH=""+app_Classpath_PATH.substring(0,((int)app_Classpath_PATH.lastIndexOf((flsep+"engine"))))icopath=app_PATH+flsep+"dat"+flsep+"sidewinder5050icons"+flsep+"ico"+flsepicoext=".gif"applicationIconMaker()}else{app_PATH=""+app_Classpath_PATH.substring(0,((int)app_Classpath_PATH.lastIndexOf(flsep+"engine")))icopath=app_PATH+flsep+"dat"+flsep+"sidewinder5050icons"+flsepicoext=".png" //req.tobe.giftestonlyapplicationIconMaker()}}catch(java.io.UnsupportedEncodingException unspenc){

    }finally{}//==instantiateerrorhandlerfortheerrorhandler(doublestageifthefirstfails)

    try{errF=app_PATH+flsep+"dat"+flsep+"errTraceSidewinder.txt"errFil=new File(errF)pr=new PrintStream(((OutputStream)new FileOutputStream(errFil,true)))//==//eiyti.printStackTrace(pr)}catch(java.io.FileNotFoundException fifterr){System.out.println("ConstructorEXCEPTION:java.io.FileNotFoundException"+errF+"ErrorhandlersystemdownSidewinderPhotoColourBalancer.java")}catch(java.lang.Exception excA){System.out.println("ConstructorEXCEPTION:java.lang.ExceptionErrorhandlersystemdownSidewinderPhotoColourBalancer.java")}finally{}

    try{String sw400pth = app_PATH+flsep+"dat"+flsep+"SidewinderA400.jpg"

    inputimage = new File(sw400pth)splatter = new Splashframe(sw400pth )uifont = ((Font)splatter.appfon) //,1,8)//(nopointing)originalwillsoonbeinanullclassimcanv = new ImageSysTest(inputimage) //GETSTHEIMAGE}catch(java.io.FileNotFoundException finotfn){finotfn.printStackTrace(pr)}catch(javax.imageio.IIOException imgioexc){imgioexc.printStackTrace(pr)}catch(java.io.IOException ioexconst){ioexconst.printStackTrace(pr)}catch(java.lang.Exception excafAS){stackExPasthru((Throwable)excafAS)}finally{}/*catch(java.io.IOExceptionioexconst){ioexconst.printStackTrace(pr)}*///rsZidx=0oldrsZidx=0//splatter.repaint(((long)newLong("10").longValue()))splatter.toFront()splatter.repaint()splatter.mssg="StartingSidewinder........"splatter.mssgPrs()//splatter.sidewindersplash.paintComponent(splatter.sidewindersplash.getGraphics())passPane=""bgbut = new JPanel[4] //WAS4NOW3bgbut[0] = new JPanel()bgbut[0].setPreferredSize(new Dimension(210,65))bgbut[0].setSize(new Dimension(210,65))bgbut[0].setLayout(new java.awt.FlowLayout(1,4,4))bgbut[0].setBackground(new Color(255,0,0))bgbut[1] = new JPanel()bgbut[1].setPreferredSize(new Dimension(210,65))bgbut[1].setSize(new Dimension(210,65))bgbut[1].setLayout(new java.awt.FlowLayout(1,4,4))bgbut[1].setBackground(new Color(0,255,0))bgbut[2] = new JPanel()bgbut[2].setPreferredSize(new Dimension(210,65))bgbut[2].setSize(new Dimension(210,65))bgbut[2].setLayout(new java.awt.FlowLayout(1,4,4))bgbut[2].setBackground(new Color(0,0,255))bgbut[3] = new JPanel()bgbut[3].setPreferredSize(new Dimension(210,65))bgbut[3].setSize(new Dimension(210,65))bgbut[3].setLayout(new java.awt.FlowLayout(1,4,4))bgbut[3].setBackground(new Color(255,255,255))//createButt()deledsplatter.toFront()splatter.repaint()splatter.mssg="Sidewinder:LoadingListGUIParts........"splatter.mssgPrs()szcombomod = new javax.swing.DefaultComboBoxModel()szcombomod.addElement((Object)"1/1")szcombomod.addElement((Object)"3/4")szcombomod.addElement((Object)"2/3")szcombomod.addElement((Object)"1/2")szcombomod.addElement((Object)"5/12")szcombomod.addElement((Object)"1/3")szcombomod.addElement((Object)"1/4")szcombomod.addElement((Object)"1/5") //szcombomod.addElement((Object)"3/16") //szcombomod.addElement((Object)"1/6") //szcombomod.addElement((Object)"1/8")szcombomod.addElement((Object)"1/10")szcombomod.addElement((Object)"1/12")szcombomod.addElement((Object)"1/16")jox = new JComboBox(szcombomod)jox.addItemListener(this)inpcombomodset = new javax.swing.DefaultComboBoxModel[4]for(int ckco=0(ckcohz){longside=true}

    float coef=0float lngz = new Integer(lsdz).floatValue()float hiz = new Integer(hz).floatValue()float wiz = new Integer(wz).floatValue()if(longside==true){ //"otherelse"istheheightcoef=lngz/wiz}else{//coef=lngz/hiz}float nht=coef*hizfloat nwd=coef*wizint wdin = (new Float(nwd).intValue())int hdin = (new Float(nht).intValue())//try{java.awt.Image bmiresiz = quickImg(wdin,hdin)BufferedImage bu = new BufferedImage(wdin,hdin,bumi.getType())Graphics gr=bu.getGraphics()gr.drawImage(bmiresiz,0,0,null)makeQuickBoard(bu,app_PATH,wdin,hdin,upordown)}catch(Exception exsxa){//System.out.println(exsxa.getMessage())exsxa.printStackTrace(pr)}finally{}}//enmeth

    void mcHue(){hu = new HueBoard(this) //WARNINGTESTPARAMETERSFEDONLY!!!!

    }//enmeth

    ////setValue()//repaint()

    void rotateCW(){work.makeParamWork(100) //swinder.bumi.getWidth()

    rotateSysClss() //newRotatorswork.setValue(10)work.repaint()//int bHI = bumi.getHeight()int bWI = bumi.getWidth()redCWRemake(bWI,bHI)//work.setValue(20)//work.repaint()//doGarbageClear()greenCWRemake(bWI,bHI)//work.setValue(30)//work.repaint()//doGarbageClear()blueCWRemake(bWI,bHI)//work.setValue(40)//work.repaint()//doGarbageClear()bmiMKrotate(bHI,bWI) //makesaCWrotatedbumi//work.setValue(50)//work.repaint()roTor = nullclearthumbL()doGarbageClear()//NOTICE(argumentsin!!!SP)FILLIN!!!MUSTBEDONEINHERErunthetranslatorpopulatormethodnextrotationPopulator(bHI,bWI)//work.setValue(70)////work.repaint()//nowsetSizesetIconrepaint//!!!!!!TPNMUSTBERESET"IN"HEREtpn.setIcon(new ImageIcon((java.awt.Image)bumi))tpn.setSize(new Dimension(bWI,bHI))tpn.repaint()//makeImgRsz(oldrsZidx)//work.setValue(100)//work.repaint()metaPne.append("===RotatedImage:==="+linesep)metaPne.append("===width:"+bumi.getWidth()+linesep)metaPne.append("===height:"+bumi.getHeight()+linesep)metaPne.append("===note:anypreviousthumnailsarecleared"+linesep)}//enmeth

    void rotateCCW(){rotateSysClss() //newRotatorsint bHI = bumi.getHeight()int bWI = bumi.getWidth()redCCWRemake(bWI,bHI)doGarbageClear()greenCCWRemake(bWI,bHI)doGarbageClear()blueCCWRemake(bWI,bHI)doGarbageClear()bmiMKrotate(bHI,bWI) //"swapstoH,Winsidethecallerfunction"makesaCCWrotatedbumiroTor = nullclearthumbL()doGarbageClear()////runthetranslatorpopulatormethodnextrotationPopulator(bHI,bWI)//nowsetSizesetIconrepaint//tpn.setIcon(newImageIcon((java.awt.Image)bumi))//tpn.setSize(newDimension(bWI,bHI))//tpn.repaint()makeImgRsz(oldrsZidx)metaPne.append("===RotatedImage:==="+linesep)metaPne.append("===width:"+bumi.getWidth()+linesep)metaPne.append("===height:"+bumi.getHeight()+linesep)metaPne.append("===note:anypreviousthumnailsarecleared"+linesep)}//enmeth

    public void actionPerformed(java.awt.event.ActionEvent e){actionComm(((String)e.getActionCommand()))//if(guiOpOccurring==false){guiOpOccurPresent(true)//JOptionPane.showMessageDialog(newJFrame(),"command(listenermethodsection):"+((String)e.getActionCommand()))try{oldrSzIdx(jox.getSelectedIndex()) //isalwayskeptbeforeabyassignmenttorSzIdx()//if(((boolean)actComm.equals("OPENFILE"))){passPane=""chooseOpenFile()if(firstopenedis==true){disnableButtons(true) //}//tpn.repaint()

    guiOpOccurPresent(false)//}else{int btyP=bumi.getType()if(((int)btyP==5) || ((int)btyP==4) || ((int)btyP==1)){ //normalRGBtruecolouroldrSzIdx(jox.getSelectedIndex()) //isalwayskeptbeforeabyassignmenttorSzIdx()if(((boolean)actComm.equals("THBOO"))&&((thumbleep.isSelected())==true)){thumbleep.setSelected(false)}else if(((boolean)actComm.equals("THBLEEP"))&&((thumboo.isSelected())==true)){thumboo.setSelected(false)}else if((boolean)actComm.equals("BLACKUNDWAAAHT")){disnableButtons(true)refreshBWmake()bnw.makeBWimage()rotationPopulator(bumi.getWidth(),bumi.getHeight())makeImgRsz(oldrsZidx)metaPne.append("===SwitchedImageToB&W==="+linesep)doGarbageClear()

    //JOptionPane.showMessageDialog(newJFrame(),"APPARRENTSEQUENCEFINNISHED???")//}else if(((boolean)actComm.equals("READYBMI"))){int wz=bumi.getWidth()int hz=bumi.getHeight()wzd.setText(new Integer(wz).toString())hzd.setText(new Integer(hz).toString())if(hz>wz){lngz.setText(hzd.getText())}else{lngz.setText(wzd.getText())}guiOpOccurPresent(false)disnableButtons(true)}else if(((boolean)actComm.equals("BMI"))){lngz.setEnabled(false) //onlylongsideboolean longside=falseint wz=bumi.getWidth()int hz=bumi.getHeight()wzd.setText(new Integer(wz).toString())hzd.setText(new Integer(hz).toString())if(wz>hz){longside=true}String aa=wzd.getText()String ab=hzd.getText()String ac=lngz.getText()//hzd.getText()//lngz.getText()boolean a1 = chKChr(aa)boolean a2 = chKChr(ab)boolean a3 = chKChr(ac)if((a1==true)&&(a2==true)&&(a3==true)){float coef=0float lngz = new Float(ac).floatValue()float hiz = new Float(ab).floatValue()float wiz = new Float(aa).floatValue()if(longside==true){ //"otherelse"istheheightcoef=lngz/wiz}else{//coef=lngz/hiz}float nht=coef*hizfloat nwd=coef*wizint wdin = (new Float(nwd).intValue())int hdin = (new Float(nht).intValue())//Image bmiresiz = bumi.getScaledInstance(wdin,hdin,4)bumi = new BufferedImage(wdin,hdin,bumi.getType())Graphics tr = bumi.getGraphics()tr.drawImage(bmiresiz,0,0,wdin,hdin,null)WritableRaster wras=bumi.getRaster()red_Overstep = rgbDimArr.colOverstepstore(0,hdin,wdin,wras)green_Overstep = rgbDimArr.colOverstepstore(1,hdin,wdin,wras)blue_Overstep = rgbDimArr.colOverstepstore(2,hdin,wdin,wras)tpn.setIcon(new ImageIcon((java.awt.Image)bumi))tpn.setSize(new Dimension(wdin,hdin))doGarbageClear()//POPULATORANDMULTIDIMMARTORESETUPAFTERRESIZINGPROCEDURE//rotationPopulator(bumi.getWidth(),bumi.getHeight())oldrSzIdx(0) //isalwayskeptbeforeabyassignmenttorSzIdx()makeImgRsz(0)jox.setSelectedIndex(0)metaPne.append("===ResizeofImageDone(previousaspectratio)==="+linesep)metaPne.append("::NewWidth:"+wdin+""+linesep)metaPne.append("::NewHeight:"+hdin+""+linesep)//RESTOREVIEWTOTHEjoxVIEWSELECTIONSETTING}else{JOptionPane.showMessageDialog(new JFrame(),"Onlynumbertobeusedastextentries!!")}//DOGARBAGECOLLECTIONHERElngz.setEnabled(true) //onlylongside//REENABLEBUTTONSFORGUIHEREguiOpOccurPresent(false)disnableButtons(true)}else if(((boolean)actComm.equals("SAVAS"))){chooseSaveAsFileLocation()guiOpOccurPresent(false)disnableButtons(true)}else if(((boolean)actComm.equals("SETTHUMBSZ"))){doSavesys() //"SETTHUMBSZ"isinthethumbimagelistenertrack}else if(((boolean)actComm.equals("SETCROP"))){if((cropsysstate==false)&&(((boolean)checkFieldCropval())==true)){doGarbageClear()//"setcrop"cropstater(true)oldrSzIdx(0) //isalwayskeptbeforeabyassignmenttorSzIdx()makeImgRsz(0)jox.setSelectedIndex(0)mkImCrpPaintSelect()doGarbageClear()}else{cropstater(false)JOptionPane.showMessageDialog(new JFrame(),"inputtypoerrorinatextentryfieldinputfieldvaluesmustbenumbers")}//enif

    disnableButtons(true)}else if(((boolean)actComm.equals("CLEARCROP"))){if(cropsysstate==true){tpn.cropIsOnflag(false)tpn.setIcon(new ImageIcon((java.awt.Image)bumi))tpn.repaint()rotationPopulator(bumi.getWidth(),bumi.getHeight())doGarbageClear()cropstater(false)//calltotpnforextraimagenulledandthendogarbagedoGarbageClear()}disnableButtons(true)}else if(((boolean)actComm.equals("DOCROP"))){if(cropsysstate==true){doGarbageClear()//if(checkFieldCropval()==true){ //!!!checkFieldCropval(excesscodethereareotherplaceshavethistestinternalbutishere//!!!topreventclasscastexceptionherecheckFieldCropval(int newide = new Integer(widefield.getText()).intValue()int newheight = new Integer(heightfield.getText()).intValue()doGarbageClear()rotateSysClss() //newRotatorsbmiMKrotate(newide,newheight) //roTor = nulldoGarbageClear()int topLpnt = new Integer(xfield.getText()).intValue()int topRpnt = new Integer(yfield.getText()).intValue()//makethenewmodifiedarraysfromtheoriginaloverstepsredCropRemake(topLpnt,topRpnt,newide,newheight)greenCropRemake(topLpnt,topRpnt,newide,newheight)blueCropRemake(topLpnt,topRpnt,newide,newheight)rotationPopulator(bumi.getWidth(),bumi.getHeight())/*TODOSETUPCOMPLETEREASSIGNINGOFiioIMAGEOBJECTSE.T.C.FORWRITEANDREFERENCESONbumi*/tpn.setSize(new Dimension(newide,newheight))tpn.setIcon(new ImageIcon(((Image)bumi)))tpn.repaint()oldrSzIdx(0) //isalwayskeptbeforeabyassignmenttorSzIdx()makeImgRsz(0)jox.setSelectedIndex(0)tpn.repaint()clearthumbL()//Stringcrppa=metaPne.getText()//metaPne.setText(crppa)String msgcrpping ="CropDone:Xpos:"+xfield.getText()+"::Ypos:"+ yfield.getText()+"::Width:"+ widefield.getText()+"::Height:"+heightfield.getText()metaPne.append("===CroppedImage:==="+linesep)metaPne.append(msgcrpping+linesep)metaPne.append("===width:"+bumi.getWidth()+linesep)metaPne.append("===height:"+bumi.getHeight()+linesep)metaPne.append("===note:anypreviousthumnailsarecleared"+linesep)//note:iioimagekeptformetadata}//enifcropstater(false)doGarbageClear()}//enifdisnableButtons(true)}else if(((boolean)actComm.equals("TEXTING"))){if(tpn.getTextFlag()==false){//stopdoublepanes//BOOLEANREQUIREDHERETOSWITCHOFFImWinselectionfontextbaud = new FontTextBoard(this)//metapaneappendisdonefromtextboardclass}disnableButtons(true)}else{//===================COMPOUNDEDthe1 = new ThreadRedux1()the1.start()//===================COMPOUNDED

    }//enlistenifels

    }//enelseforIMAGERESTRAINTS

    //}//enelseforopen

    //}catch(java.lang.IllegalThreadStateException thrupt1){stackExPasthru((Throwable)thrupt1)}catch(java.lang.Exception irexc1){stackExPasthru((Throwable)irexc1)}finally{}//guiOpOccurPresent(false)//if(oldrsZidx!=rsZidx){makeImgRsz(rsZidx)}else{makeImgRsz(oldrsZidx)}tpn.repaint()

    if(cropsysstate==true){//disnableButtons(false)crpRccw.setEnabled(false)crpcw.setEnabled(false)//!!!DONOTputguiOpOccurPresent(inhereif(oldrsZidx!=rsZidx){makeImgRsz(rsZidx)}else{makeImgRsz(oldrsZidx)}tpn.repaint()}else{crpRccw.setEnabled(true)crpcw.setEnabled(true)if(the1!=null){the1 = null}else{disLowerButs(true)}//eninnerifelsint bHI = bumi.getHeight()int bWI = bumi.getWidth()rotationPopulator(bWI,bHI)}//enifelsdoGarbageClear()}//enifguioccurend

    }//eneventmeth

    void rotationPopulator(int bumw,int bumhi){ //argsmaybereplacedWritableRaster bumras = bumi.getRaster()int caccr = 0//System.out.println("hibum:"+hibum+"wibum"+wibum+"bumw"+bumw+"bumhi"+bumhi)while(caccr

  • /*THISistheF2Versionsomewherenearcompletedforrelease.Theoldsitewashttp://www.nicephotogjsp.netthenewsiteishttp://www.windsolarhybridaustralia.x10.mxThisapplicationisnotprincipleywritteninLinuxorWindowsandissometimesperversiononlyusableinoneortheotherOSsystem.ItisendevouredtobewrittenforbothandallWindowsandNIX'sOS'sintheonedownload...cdC:\SideWinderColourBalancer\engineFILENAMESHOULDBE"SideWinderPhotoColourBalancer.java"writtenbyMrSamuelAMarchantSydneyNSWAustraliaOctober20102015versionF2cdC:\SideWinderColourBalancer\engine\sidewinderutil"MultiDimArr.java"writtenbyMrSamuelAMarchantSydneyNSWAustraliaOctober2010"C:\ProgramFiles\Java\jdk1.5.0_07\bin\javac.exe"SidewinderPhotoColourBalancer.java"C:\ProgramFiles\Java\jdk1.5.0_07\bin\java.exe"classpath"C:\SideWinderColourBalancer\engine".SidewinderPhotoColourBalancer"C:\ProgramFiles\Java\jdk1.6.0_22\bin\javac.exe"SidewinderPhotoColourBalancer.java"C:\ProgramFiles\Java\jdk1.6.0_22\bin\java.exe"classpath"C:\SideWinderColourBalancer\engine".SidewinderPhotoColourBalancer*/import java.awt.*import java.awt.event.ActionListenerimport java.awt.event.ActionEventimport java.awt.Dimensionimport java.awt.image.*import javax.swing.event.*import java.awt.event.ItemEventimport java.awt.event.WindowAdapterimport java.awt.event.WindowEventimport javax.swing.*import javax.swing.filechooser.FileFilter//importjavax.swing.filechooser.FileNameExtensionFilterimport java.io.*import javax.imageio.*import javax.imageio.spi.*import javax.imageio.stream.*import javax.imageio.metadata.*//import java.util.*import java.util.Listimport java.util.Iterator//importsidewinderutil.*//importsidewinderutil.MultiDimArr//importsidewinderutil.Rotators//importsidewinderutil.Cropcoords//importsidewinderutil.IMGextensions//importsidewinderutil.FlipInvert//import java.awt.font.*import java.awt.geom.*import java.awt.FontMetricsimport java.awt.font.LineMetricsimport java.awt.GraphicsEnvironment//class SidewinderPhotoColourBalancer extends javax.swing.JFrame implements java.awt.event.ActionListener,java.awt.event.ItemListener{private final String[] uibuttext={"Up","Down","Up","Down","Up","Down","Up","Down","Open","Save"}private final String[] uibuttcommand={"REDUP","REDDOWN","GREENUP","GREENDOWN","BLUEUP","BLUEDOWN","WHITEUP","WHITEDOWN","OPENFILE","SAVAS"}private final java.awt.Color[] cols = {new Color(255,0,0),new Color(0,255,0),new Color(0,0,255),new Color(0,0,0),new Color(255,255,255)}//JCheckBoxchkwhtclbg//staticjava.util.IteratoriwrtRsstatic javax.imageio.ImageIO ioStreamSyscalls2 //INNERCLASSESCANNOTHAVESTATICDECLARATIONSstatic java.util.Iterator iwrtRs //INNERCLASSESCANNOTHAVESTATICDECLARATIONSRGBchangeCoeffLinear coloffl//RGBchangeCoeffContrastcoloffcRGBchangeCoeffLinearSingle coloffsRGBchangeCoeffLinearSingleHueSetter colHueRGBchangeCoeffLinearGammaSetter rgbSetgammHueBoard huQuickBoardColour qbrdFontTextBoard fontextbaud////JProgressBarwrkprog//WorkBarwrkPROGWorkWindowProgressor wrkprogessWorkBar workjava.awt.Image sw32ico//int alngPValjava.util.Timer tmObject wimg //WritImgOutJPEGWritImgOutPNGWritImgOutBMPFrame dialFramSplashframe splatter//JButton bwbttn//FchComp pfcJPanel pl//javax.swing.JSplitPane panesplitjavax.swing.JPanel labpanjava.awt.image.ImageObserver obsrvlabjavax.swing.JViewport[] panviewset //javax.swing.JPanel[] panset //javax.swing.JScrollPane[] panscro //javax.swing.JTextArea metaPneJButton[] colbuttJCheckBox thumboo,thumbleepDefaultComboBoxModel[] inpcombomodsetJComboBox[] inptnumsDefaultComboBoxModel szcombomodJComboBox joxint rsZidx //comboindexforresizeint oldrsZidxImageWriteParam wrtPrmJPanel toolpan,conslcntbttjava.io.FileOutputStream foutstrm//java.io.RandomAccessFilefoutstrm//java.io.Filefoutstrm//javax.imageio.stream.FileImageOutputStreamfoutstrmConvertToBandW bnwWritableRaster wrasMultiDimArr rgbDimArrRotators roTor //roTor=newRotators(bumi.getType())//ThreadReduxPriorthePRThreadRedux1 the1 //=newThreadRedux1()ThreadRedux2 the2ThreadRedux3 the3//ThreadRedux2theOther//=newThreadRedux2(e.getActionCommand())actComm=e.getActionCommand()String actCommString passPaneint imHint lenwshort[][] red_Overstepshort[][] green_Overstepshort[][] blue_Overstep//MULTIDIMINITSImageSysTest imcanvGraphics glong tme = 50ImWin tpnFont uifontJFileChooser flchsJFrame parentFile inputimageString curropendirString currsavdir//==errorfileiftheerrorhandlerhasaproblemFile errFil //errorfileinsu.datPrintStream pr //errorprintstramforstackTracemethodreadyString errFint buttonjump=1//

    JButton rdysz,mkrsz,quickclru,quickclrd,huebordJTextField lngz,wzd,hzd

    //JPanel[] bgbut//javax.imageio.ImageWriteriwRTjavax.imageio.IIOParamController imPrmCntString app_Classpath_PATH,app_PATH,wneibyte[] sysOSString flsepString linesepboolean firstopenedisboolean guiOpOccurring////thumbsizerpanelJFrame thmbFrmJPanel frmpanlJLabel settJComboBox settLongJButton setchoiceDefaultComboBoxModel thmszint szMkThmb////THUMBVIEWERJFrame thumbVIEWJScrollPane vwscrollJViewport cviewJPanel frmevwpnlJPanel compvwJLabel[] thmImgViewString thumbinf//JPanel contain,containR,containL,contButtRow,crpWHlab,crpWHfields,crpXYfields,crpXYlabJButton crpSet,crpClr,crpCrop,crpRccw,crpcw,crpRFror,crpRmror,crptxtJTextField widefield,heightfield,xfield,yfieldJLabel wideLab,heightLab,xfieldLab,yfieldLabjava.util.Locale AorialeComponentOrientation AcmpoDefaultComboBoxModel omodJComboBox crxboolean cropsysstate//BufferedImagecopybumi//GraphicsgGraphics ggRectangle rb//NESTEDREADERCLASSPARTSstatic ImageIO ioStreamSyscallsstatic java.util.Iterator imReaders //java.util.IteratorimReaders//javax.imageio.stream.ImageInputStream imgInpStrjavax.imageio.ImageReader readIMGjavax.imageio.ImageReadParam rdrPRMjavax.imageio.IIOImage iioiMIGBufferedImage bumiImage bumiSZpaint//javax.imageio.metadata.IIOMetadata imgIIOmtdajavax.imageio.metadata.IIOMetadata imgIIOmtdaRead//org.w3c.dom.Noderootnod//StringmtdaTreeString imgfilenameFile imgFilingFileInputStream flimstrm//http://www.oracle.com/technetwork/articles/javase/generics136597.htmljava.util.List imgThmbNl//int numThumb//String[] args/*"180flip.png","0blueminus.png","1blueplus.png","2cropclear.png","3cropdo.png","4cropset.png","5doresize.png","6gammapply.png","7gammatry.png","8greenminus.png","9greenplus.png","10hueboard.png","11longside.png","12mirror.png","13open.png","14quickboardminus.png","15quickboardplus.png","16redminus.png","17redplus.png","18rotateccw.png","19rotatecw.png","20saveas.png","21textboard.png","22textclear.png","23textry2.png","24textsize.png","25toblackandwhite.png","26whiteminus.png","27whiteplus.png"}28*/String icopathString icoextfinal String[] appicons = {"180flip","blueminus","blueplus","cropclear","cropdo","cropset","doresize","gammapply","gammatry","greenminus","greenplus","hueboard","longside","mirror","open","quickboardminus","quickboardplus","redminus","redplus","rotateccw","rotatecw","saveas","textboard","textclear","textry2","textsize","toblackandwhite","whiteminus","whiteplus"}Image[] appiconsIMG

    //CONSTRUCTORFOLLOWSSidewinderPhotoColourBalancer(String[] args){ //takesastringargfromdraganddroponiconlater//INSIDECONSTRUCTORthis.args=args//firstopenedis=falsecropsysstate=falseAoriale = (java.util.Locale)Locale.US //java.util.LocaleAorialeComponentOrientationAcmpoAcmpo = ComponentOrientation.getOrientation(Aoriale)setComponentOrientation(Acmpo)try{flsep=System.getProperty("file.separator")linesep=System.getProperty("line.separator")curropendir = System.getProperty("user.home")currsavdir = System.getProperty("user.home")sysOS=(System.getProperty("os.name")).getBytes("ISO88591")wnei = new String(sysOS,0,sysOS.length)app_Classpath_PATH=System.getProperty("java.class.path")//if((wnei.equals("WindowsXP"))||(wnei.equals("WindowsNT"))||(wnei.equals("Windows2000"))||(wnei.equals("Windows98"))||(wnei.equals("WindowsMe"))||(wnei.equals("Windows2003"))||(wnei.equals("Windows_NT"))||(wnei.equals("WindowsNT(unknown)"))||(wnei.equals("WindowsVista"))){app_PATH=""+app_Classpath_PATH.substring(0,((int)app_Classpath_PATH.lastIndexOf((flsep+"engine"))))icopath=app_PATH+flsep+"dat"+flsep+"sidewinder5050icons"+flsep+"ico"+flsepicoext=".gif"applicationIconMaker()}else{app_PATH=""+app_Classpath_PATH.substring(0,((int)app_Classpath_PATH.lastIndexOf(flsep+"engine")))icopath=app_PATH+flsep+"dat"+flsep+"sidewinder5050icons"+flsepicoext=".png" //req.tobe.giftestonlyapplicationIconMaker()}}catch(java.io.UnsupportedEncodingException unspenc){

    }finally{}//==instantiateerrorhandlerfortheerrorhandler(doublestageifthefirstfails)

    try{errF=app_PATH+flsep+"dat"+flsep+"errTraceSidewinder.txt"errFil=new File(errF)pr=new PrintStream(((OutputStream)new FileOutputStream(errFil,true)))//==//eiyti.printStackTrace(pr)}catch(java.io.FileNotFoundException fifterr){System.out.println("ConstructorEXCEPTION:java.io.FileNotFoundException"+errF+"ErrorhandlersystemdownSidewinderPhotoColourBalancer.java")}catch(java.lang.Exception excA){System.out.println("ConstructorEXCEPTION:java.lang.ExceptionErrorhandlersystemdownSidewinderPhotoColourBalancer.java")}finally{}

    try{String sw400pth = app_PATH+flsep+"dat"+flsep+"SidewinderA400.jpg"

    inputimage = new File(sw400pth)splatter = new Splashframe(sw400pth )uifont = ((Font)splatter.appfon) //,1,8)//(nopointing)originalwillsoonbeinanullclassimcanv = new ImageSysTest(inputimage) //GETSTHEIMAGE}catch(java.io.FileNotFoundException finotfn){finotfn.printStackTrace(pr)}catch(javax.imageio.IIOException imgioexc){imgioexc.printStackTrace(pr)}catch(java.io.IOException ioexconst){ioexconst.printStackTrace(pr)}catch(java.lang.Exception excafAS){stackExPasthru((Throwable)excafAS)}finally{}/*catch(java.io.IOExceptionioexconst){ioexconst.printStackTrace(pr)}*///rsZidx=0oldrsZidx=0//splatter.repaint(((long)newLong("10").longValue()))splatter.toFront()splatter.repaint()splatter.mssg="StartingSidewinder........"splatter.mssgPrs()//splatter.sidewindersplash.paintComponent(splatter.sidewindersplash.getGraphics())passPane=""bgbut = new JPanel[4] //WAS4NOW3bgbut[0] = new JPanel()bgbut[0].setPreferredSize(new Dimension(210,65))bgbut[0].setSize(new Dimension(210,65))bgbut[0].setLayout(new java.awt.FlowLayout(1,4,4))bgbut[0].setBackground(new Color(255,0,0))bgbut[1] = new JPanel()bgbut[1].setPreferredSize(new Dimension(210,65))bgbut[1].setSize(new Dimension(210,65))bgbut[1].setLayout(new java.awt.FlowLayout(1,4,4))bgbut[1].setBackground(new Color(0,255,0))bgbut[2] = new JPanel()bgbut[2].setPreferredSize(new Dimension(210,65))bgbut[2].setSize(new Dimension(210,65))bgbut[2].setLayout(new java.awt.FlowLayout(1,4,4))bgbut[2].setBackground(new Color(0,0,255))bgbut[3] = new JPanel()bgbut[3].setPreferredSize(new Dimension(210,65))bgbut[3].setSize(new Dimension(210,65))bgbut[3].setLayout(new java.awt.FlowLayout(1,4,4))bgbut[3].setBackground(new Color(255,255,255))//createButt()deledsplatter.toFront()splatter.repaint()splatter.mssg="Sidewinder:LoadingListGUIParts........"splatter.mssgPrs()szcombomod = new javax.swing.DefaultComboBoxModel()szcombomod.addElement((Object)"1/1")szcombomod.addElement((Object)"3/4")szcombomod.addElement((Object)"2/3")szcombomod.addElement((Object)"1/2")szcombomod.addElement((Object)"5/12")szcombomod.addElement((Object)"1/3")szcombomod.addElement((Object)"1/4")szcombomod.addElement((Object)"1/5") //szcombomod.addElement((Object)"3/16") //szcombomod.addElement((Object)"1/6") //szcombomod.addElement((Object)"1/8")szcombomod.addElement((Object)"1/10")szcombomod.addElement((Object)"1/12")szcombomod.addElement((Object)"1/16")jox = new JComboBox(szcombomod)jox.addItemListener(this)inpcombomodset = new javax.swing.DefaultComboBoxModel[4]for(int ckco=0(ckcohz){longside=true}

    float coef=0float lngz = new Integer(lsdz).floatValue()float hiz = new Integer(hz).floatValue()float wiz = new Integer(wz).floatValue()if(longside==true){ //"otherelse"istheheightcoef=lngz/wiz}else{//coef=lngz/hiz}float nht=coef*hizfloat nwd=coef*wizint wdin = (new Float(nwd).intValue())int hdin = (new Float(nht).intValue())//try{java.awt.Image bmiresiz = quickImg(wdin,hdin)BufferedImage bu = new BufferedImage(wdin,hdin,bumi.getType())Graphics gr=bu.getGraphics()gr.drawImage(bmiresiz,0,0,null)makeQuickBoard(bu,app_PATH,wdin,hdin,upordown)}catch(Exception exsxa){//System.out.println(exsxa.getMessage())exsxa.printStackTrace(pr)}finally{}}//enmeth

    void mcHue(){hu = new HueBoard(this) //WARNINGTESTPARAMETERSFEDONLY!!!!

    }//enmeth

    ////setValue()//repaint()

    void rotateCW(){work.makeParamWork(100) //swinder.bumi.getWidth()

    rotateSysClss() //newRotatorswork.setValue(10)work.repaint()//int bHI = bumi.getHeight()int bWI = bumi.getWidth()redCWRemake(bWI,bHI)//work.setValue(20)//work.repaint()//doGarbageClear()greenCWRemake(bWI,bHI)//work.setValue(30)//work.repaint()//doGarbageClear()blueCWRemake(bWI,bHI)//work.setValue(40)//work.repaint()//doGarbageClear()bmiMKrotate(bHI,bWI) //makesaCWrotatedbumi//work.setValue(50)//work.repaint()roTor = nullclearthumbL()doGarbageClear()//NOTICE(argumentsin!!!SP)FILLIN!!!MUSTBEDONEINHERErunthetranslatorpopulatormethodnextrotationPopulator(bHI,bWI)//work.setValue(70)////work.repaint()//nowsetSizesetIconrepaint//!!!!!!TPNMUSTBERESET"IN"HEREtpn.setIcon(new ImageIcon((java.awt.Image)bumi))tpn.setSize(new Dimension(bWI,bHI))tpn.repaint()//makeImgRsz(oldrsZidx)//work.setValue(100)//work.repaint()metaPne.append("===RotatedImage:==="+linesep)metaPne.append("===width:"+bumi.getWidth()+linesep)metaPne.append("===height:"+bumi.getHeight()+linesep)metaPne.append("===note:anypreviousthumnailsarecleared"+linesep)}//enmeth

    void rotateCCW(){rotateSysClss() //newRotatorsint bHI = bumi.getHeight()int bWI = bumi.getWidth()redCCWRemake(bWI,bHI)doGarbageClear()greenCCWRemake(bWI,bHI)doGarbageClear()blueCCWRemake(bWI,bHI)doGarbageClear()bmiMKrotate(bHI,bWI) //"swapstoH,Winsidethecallerfunction"makesaCCWrotatedbumiroTor = nullclearthumbL()doGarbageClear()////runthetranslatorpopulatormethodnextrotationPopulator(bHI,bWI)//nowsetSizesetIconrepaint//tpn.setIcon(newImageIcon((java.awt.Image)bumi))//tpn.setSize(newDimension(bWI,bHI))//tpn.repaint()makeImgRsz(oldrsZidx)metaPne.append("===RotatedImage:==="+linesep)metaPne.append("===width:"+bumi.getWidth()+linesep)metaPne.append("===height:"+bumi.getHeight()+linesep)metaPne.append("===note:anypreviousthumnailsarecleared"+linesep)}//enmeth

    public void actionPerformed(java.awt.event.ActionEvent e){actionComm(((String)e.getActionCommand()))//if(guiOpOccurring==false){guiOpOccurPresent(true)//JOptionPane.showMessageDialog(newJFrame(),"command(listenermethodsection):"+((String)e.getActionCommand()))try{oldrSzIdx(jox.getSelectedIndex()) //isalwayskeptbeforeabyassignmenttorSzIdx()//if(((boolean)actComm.equals("OPENFILE"))){passPane=""chooseOpenFile()if(firstopenedis==true){disnableButtons(true) //}//tpn.repaint()

    guiOpOccurPresent(false)//}else{int btyP=bumi.getType()if(((int)btyP==5) || ((int)btyP==4) || ((int)btyP==1)){ //normalRGBtruecolouroldrSzIdx(jox.getSelectedIndex()) //isalwayskeptbeforeabyassignmenttorSzIdx()if(((boolean)actComm.equals("THBOO"))&&((thumbleep.isSelected())==true)){thumbleep.setSelected(false)}else if(((boolean)actComm.equals("THBLEEP"))&&((thumboo.isSelected())==true)){thumboo.setSelected(false)}else if((boolean)actComm.equals("BLACKUNDWAAAHT")){disnableButtons(true)refreshBWmake()bnw.makeBWimage()rotationPopulator(bumi.getWidth(),bumi.getHeight())makeImgRsz(oldrsZidx)metaPne.append("===SwitchedImageToB&W==="+linesep)doGarbageClear()

    //JOptionPane.showMessageDialog(newJFrame(),"APPARRENTSEQUENCEFINNISHED???")//}else if(((boolean)actComm.equals("READYBMI"))){int wz=bumi.getWidth()int hz=bumi.getHeight()wzd.setText(new Integer(wz).toString())hzd.setText(new Integer(hz).toString())if(hz>wz){lngz.setText(hzd.getText())}else{lngz.setText(wzd.getText())}guiOpOccurPresent(false)disnableButtons(true)}else if(((boolean)actComm.equals("BMI"))){lngz.setEnabled(false) //onlylongsideboolean longside=falseint wz=bumi.getWidth()int hz=bumi.getHeight()wzd.setText(new Integer(wz).toString())hzd.setText(new Integer(hz).toString())if(wz>hz){longside=true}String aa=wzd.getText()String ab=hzd.getText()String ac=lngz.getText()//hzd.getText()//lngz.getText()boolean a1 = chKChr(aa)boolean a2 = chKChr(ab)boolean a3 = chKChr(ac)if((a1==true)&&(a2==true)&&(a3==true)){float coef=0float lngz = new Float(ac).floatValue()float hiz = new Float(ab).floatValue()float wiz = new Float(aa).floatValue()if(longside==true){ //"otherelse"istheheightcoef=lngz/wiz}else{//coef=lngz/hiz}float nht=coef*hizfloat nwd=coef*wizint wdin = (new Float(nwd).intValue())int hdin = (new Float(nht).intValue())//Image bmiresiz = bumi.getScaledInstance(wdin,hdin,4)bumi = new BufferedImage(wdin,hdin,bumi.getType())Graphics tr = bumi.getGraphics()tr.drawImage(bmiresiz,0,0,wdin,hdin,null)WritableRaster wras=bumi.getRaster()red_Overstep = rgbDimArr.colOverstepstore(0,hdin,wdin,wras)green_Overstep = rgbDimArr.colOverstepstore(1,hdin,wdin,wras)blue_Overstep = rgbDimArr.colOverstepstore(2,hdin,wdin,wras)tpn.setIcon(new ImageIcon((java.awt.Image)bumi))tpn.setSize(new Dimension(wdin,hdin))doGarbageClear()//POPULATORANDMULTIDIMMARTORESETUPAFTERRESIZINGPROCEDURE//rotationPopulator(bumi.getWidth(),bumi.getHeight())oldrSzIdx(0) //isalwayskeptbeforeabyassignmenttorSzIdx()makeImgRsz(0)jox.setSelectedIndex(0)metaPne.append("===ResizeofImageDone(previousaspectratio)==="+linesep)metaPne.append("::NewWidth:"+wdin+""+linesep)metaPne.append("::NewHeight:"+hdin+""+linesep)//RESTOREVIEWTOTHEjoxVIEWSELECTIONSETTING}else{JOptionPane.showMessageDialog(new JFrame(),"Onlynumbertobeusedastextentries!!")}//DOGARBAGECOLLECTIONHERElngz.setEnabled(true) //onlylongside//REENABLEBUTTONSFORGUIHEREguiOpOccurPresent(false)disnableButtons(true)}else if(((boolean)actComm.equals("SAVAS"))){chooseSaveAsFileLocation()guiOpOccurPresent(false)disnableButtons(true)}else if(((boolean)actComm.equals("SETTHUMBSZ"))){doSavesys() //"SETTHUMBSZ"isinthethumbimagelistenertrack}else if(((boolean)actComm.equals("SETCROP"))){if((cropsysstate==false)&&(((boolean)checkFieldCropval())==true)){doGarbageClear()//"setcrop"cropstater(true)oldrSzIdx(0) //isalwayskeptbeforeabyassignmenttorSzIdx()makeImgRsz(0)jox.setSelectedIndex(0)mkImCrpPaintSelect()doGarbageClear()}else{cropstater(false)JOptionPane.showMessageDialog(new JFrame(),"inputtypoerrorinatextentryfieldinputfieldvaluesmustbenumbers")}//enif

    disnableButtons(true)}else if(((boolean)actComm.equals("CLEARCROP"))){if(cropsysstate==true){tpn.cropIsOnflag(false)tpn.setIcon(new ImageIcon((java.awt.Image)bumi))tpn.repaint()rotationPopulator(bumi.getWidth(),bumi.getHeight())doGarbageClear()cropstater(false)//calltotpnforextraimagenulledandthendogarbagedoGarbageClear()}disnableButtons(true)}else if(((boolean)actComm.equals("DOCROP"))){if(cropsysstate==true){doGarbageClear()//if(checkFieldCropval()==true){ //!!!checkFieldCropval(excesscodethereareotherplaceshavethistestinternalbutishere//!!!topreventclasscastexceptionherecheckFieldCropval(int newide = new Integer(widefield.getText()).intValue()int newheight = new Integer(heightfield.getText()).intValue()doGarbageClear()rotateSysClss() //newRotatorsbmiMKrotate(newide,newheight) //roTor = nulldoGarbageClear()int topLpnt = new Integer(xfield.getText()).intValue()int topRpnt = new Integer(yfield.getText()).intValue()//makethenewmodifiedarraysfromtheoriginaloverstepsredCropRemake(topLpnt,topRpnt,newide,newheight)greenCropRemake(topLpnt,topRpnt,newide,newheight)blueCropRemake(topLpnt,topRpnt,newide,newheight)rotationPopulator(bumi.getWidth(),bumi.getHeight())/*TODOSETUPCOMPLETEREASSIGNINGOFiioIMAGEOBJECTSE.T.C.FORWRITEANDREFERENCESONbumi*/tpn.setSize(new Dimension(newide,newheight))tpn.setIcon(new ImageIcon(((Image)bumi)))tpn.repaint()oldrSzIdx(0) //isalwayskeptbeforeabyassignmenttorSzIdx()makeImgRsz(0)jox.setSelectedIndex(0)tpn.repaint()clearthumbL()//Stringcrppa=metaPne.getText()//metaPne.setText(crppa)String msgcrpping ="CropDone:Xpos:"+xfield.getText()+"::Ypos:"+ yfield.getText()+"::Width:"+ widefield.getText()+"::Height:"+heightfield.getText()metaPne.append("===CroppedImage:==="+linesep)metaPne.append(msgcrpping+linesep)metaPne.append("===width:"+bumi.getWidth()+linesep)metaPne.append("===height:"+bumi.getHeight()+linesep)metaPne.append("===note:anypreviousthumnailsarecleared"+linesep)//note:iioimagekeptformetadata}//enifcropstater(false)doGarbageClear()}//enifdisnableButtons(true)}else if(((boolean)actComm.equals("TEXTING"))){if(tpn.getTextFlag()==false){//stopdoublepanes//BOOLEANREQUIREDHERETOSWITCHOFFImWinselectionfontextbaud = new FontTextBoard(this)//metapaneappendisdonefromtextboardclass}disnableButtons(true)}else{//===================COMPOUNDEDthe1 = new ThreadRedux1()the1.start()//===================COMPOUNDED

    }//enlistenifels

    }//enelseforIMAGERESTRAINTS

    //}//enelseforopen

    //}catch(java.lang.IllegalThreadStateException thrupt1){stackExPasthru((Throwable)thrupt1)}catch(java.lang.Exception irexc1){stackExPasthru((Throwable)irexc1)}finally{}//guiOpOccurPresent(false)//if(oldrsZidx!=rsZidx){makeImgRsz(rsZidx)}else{makeImgRsz(oldrsZidx)}tpn.repaint()

    if(cropsysstate==true){//disnableButtons(false)crpRccw.setEnabled(false)crpcw.setEnabled(false)//!!!DONOTputguiOpOccurPresent(inhereif(oldrsZidx!=rsZidx){makeImgRsz(rsZidx)}else{makeImgRsz(oldrsZidx)}tpn.repaint()}else{crpRccw.setEnabled(true)crpcw.setEnabled(true)if(the1!=null){the1 = null}else{disLowerButs(true)}//eninnerifelsint bHI = bumi.getHeight()int bWI = bumi.getWidth()rotationPopulator(bWI,bHI)}//enifelsdoGarbageClear()}//enifguioccurend

    }//eneventmeth

    void rotationPopulator(int bumw,int bumhi){ //argsmaybereplacedWritableRaster bumras = bumi.getRaster()int caccr = 0//System.out.println("hibum:"+hibum+"wibum"+wibum+"bumw"+bumw+"bumhi"+bumhi)while(caccr

  • /*THISistheF2Versionsomewherenearcompletedforrelease.Theoldsitewashttp://www.nicephotogjsp.netthenewsiteishttp://www.windsolarhybridaustralia.x10.mxThisapplicationisnotprincipleywritteninLinuxorWindowsandissometimesperversiononlyusableinoneortheotherOSsystem.ItisendevouredtobewrittenforbothandallWindowsandNIX'sOS'sintheonedownload...cdC:\SideWinderColourBalancer\engineFILENAMESHOULDBE"SideWinderPhotoColourBalancer.java"writtenbyMrSamuelAMarchantSydneyNSWAustraliaOctober20102015versionF2cdC:\SideWinderColourBalancer\engine\sidewinderutil"MultiDimArr.java"writtenbyMrSamuelAMarchantSydneyNSWAustraliaOctober2010"C:\ProgramFiles\Java\jdk1.5.0_07\bin\javac.exe"SidewinderPhotoColourBalancer.java"C:\ProgramFiles\Java\jdk1.5.0_07\bin\java.exe"classpath"C:\SideWinderColourBalancer\engine".SidewinderPhotoColourBalancer"C:\ProgramFiles\Java\jdk1.6.0_22\bin\javac.exe"SidewinderPhotoColourBalancer.java"C:\ProgramFiles\Java\jdk1.6.0_22\bin\java.exe"classpath"C:\SideWinderColourBalancer\engine".SidewinderPhotoColourBalancer*/import java.awt.*import java.awt.event.ActionListenerimport java.awt.event.ActionEventimport java.awt.Dimensionimport java.awt.image.*import javax.swing.event.*import java.awt.event.ItemEventimport java.awt.event.WindowAdapterimport java.awt.event.WindowEventimport javax.swing.*import javax.swing.filechooser.FileFilter//importjavax.swing.filechooser.FileNameExtensionFilterimport java.io.*import javax.imageio.*import javax.imageio.spi.*import javax.imageio.stream.*import javax.imageio.metadata.*//import java.util.*import java.util.Listimport java.util.Iterator//importsidewinderutil.*//importsidewinderutil.MultiDimArr//importsidewinderutil.Rotators//importsidewinderutil.Cropcoords//importsidewinderutil.IMGextensions//importsidewinderutil.FlipInvert//import java.awt.font.*import java.awt.geom.*import java.awt.FontMetricsimport java.awt.font.LineMetricsimport java.awt.GraphicsEnvironment//class SidewinderPhotoColourBalancer extends javax.swing.JFrame implements java.awt.event.ActionListener,java.awt.event.ItemListener{private final String[] uibuttext={"Up","Down","Up","Down","Up","Down","Up","Down","Open","Save"}private final String[] uibuttcommand={"REDUP","REDDOWN","GREENUP","GREENDOWN","BLUEUP","BLUEDOWN","WHITEUP","WHITEDOWN","OPENFILE","SAVAS"}private final java.awt.Color[] cols = {new Color(255,0,0),new Color(0,255,0),new Color(0,0,255),new Color(0,0,0),new Color(255,255,255)}//JCheckBoxchkwhtclbg//staticjava.util.IteratoriwrtRsstatic javax.imageio.ImageIO ioStreamSyscalls2 //INNERCLASSESCANNOTHAVESTATICDECLARATIONSstatic java.util.Iterator iwr