[SOLVED] Window colors and the .Xdefaults file.

Normally I use a very lightweight x11 setup on my system (ratpoison+a few applications like firefox), but recently I have been experimenting with some more unnecessary eye-candy on an usb memory (beryl and kde... nice:cool:), and after using the color settings program that comes with kde I started to think if it would be possible to do something like setting a new background color for all windows (instead of the gray color) using the .Xdefaults file.
So after booting back to my normal system (with the ratpoison wm), I changed my (xterm focused ) .Xdefaults file:
XTerm*faceName: Bitstream Vera Sans Mono:size=11
XTerm*boldFont: Bitstream Vera Sans Mono:style=Bold:size=11
XTerm*loginShell: true
XTerm*scrollBar: false
XTerm*eightBitInput: false
XTerm*metaSendsEscape: true
*background: black
*foreground: green
XTerm*color0: black
XTerm*color1: red
XTerm*color2: green
XTerm*color3: yellow
XTerm*color4: blue
XTerm*color5: magenta
XTerm*color6: cyan
XTerm*color7: white
(Note that I removed XTerm from the background and foreground.)
Result! The xpdf application changed colors!
However this setting doesn't affect firefox thunderbird or oo.org...:/
The kde color manager does change the colors of firefox and thunderbird, so hows that possible (I tried `xrdb>~/.Xdefaults` and disactivate the global coloring option in kde and then running xrdb ~/.Xdefaults on my usb system, but that didn't work either)?
Last edited by 1311219 (2007-03-24 12:05:13)

1311219 wrote:Thanks! now I only have to find a way to change the default colors in gtk... I suppose it's similar to xrdb(I saw something about an gtk.rc.mine file somewhere)?
Most people use themes like those on Gnome-look. The theme syntax is human-readable, so download one you like and tweak it to use your custom colors.
You can switch GTK themes using a program like gtk-chtheme (in community).
btw/OffTopic: OO.org looks a bit different when it uses gtk, what does it use normally(or is it just different themes?)?
AFAIK it uses its own custom cross-platform toolkit. Actually, it always uses the custom toolkit, but the FORCE_DESKTOP variable makes it try to copy your GTK (or QT if you set it to "kde") look. It doesn't manage 100% integration, the menubars and dialogs still look a little "off." Firefox and Thunderbird use a similar tactic, but always copy GTK.
Last edited by skymt (2007-03-23 20:36:11)

Similar Messages

  • What is the location for the swatches file in the illustrator product part of Adobe Creative Suite 3 Design Premium for windows (date and lenght)? File that manges its funcionallity.  Thanks

    As per adobe agent chat representative, the following question is posted on the fórum to obtain an answe from adobe.
    What is the location for the swatches file in the illustrator product part of Adobe Creative Suite 3 Design Premium for windows (date and lenght)? File that manges its funcionallity.
    Thanks
    <moved from downloading,installing,setting up - kglad>

    Illustrator is not working as it should...
    I want them to compare the original size and date of creation with what I have installed on my computer... I have installed several times with my original CD and I tried once downloading the files from the adobe site (using my own license). I suspect the files has been modified or renamed on my laptop by an external unauthorized user causing the malfunction of the application. 
    Customer services does not support CS3 anymore and the updates / patches in the adobe site does not solve the problem... They redirect me to the forums for support...
    Presently, my problem is that after creating a swatch and drag it to the swatch panel, it does not fill as it should a new form... Now, after deactivating and activating my license the swatch seems to fill the new form but when the filter that the swatch has is persistence in the next filling object created even though a different color is being used as a fill (X)... Help in the creation of a swatch over the internet just complicate the issue.
    That's why I would like to know whether updates on my product are being received or files are being replaced without my knowledge...
    Thanks...
    PS Do you know how to contact a staff adobe employer on the forums?

  • I had a windows laptop, and I save files like photos, documents, videos and other things on an external hard drive, and now I want to move those files to the Mac book Pro, and then move those files again to another external hard drive 1T. My question is:

    I had a windows laptop, and I save files like photos,documents, videos and other things on an external hard drive, and now I want tomove those files to the Mac book Pro, and then move those files again toanother external hard drive 1T. My question is: Is it possible? Doing this willnot affect the files that I had in windows? No information is lost? or how cani do it?

    Connect the external drive to your Mac and drag the files from it to your Mac's internal drive. Then dismount and disconnect the external drive, connect the 1TB external drive, and drag the files from the internal drive onto the external. Nothing will have been deleted from any of the drives up to this point; the files will only have been copied. Verify that the files are readable. There's no reason they shouldn't be; this is just a precaution.
    Now if you wish to delete the files from any of the drives, drag them to the Trash, and Empty the Trash while the drive from which they came is still connected. If you disconnect the drive before emptying the Trash, the files you were trying to remove from it won't be deleted. They'll remain in the Trash and continue to take up space on the drive.
    Note that if your external drives are in NTFS format, you won't be able to write anything to them or delete anything from them, though you will be able to read and copy the files they contain. The NTFS disk format is read-only to the Mac OS, unless you have a third-party NTFS driver installed. To make your drives cross-platform readable and writable, you must reformat them in the FAT32 or ExFAT format.

  • I uninstalled itunes, downloaded new version and the setup file won't launch. I'm running Windows Vista 64-bit.  Can anyone help?

    I uninstalled itunes, downloaded new version and the setup file won't launch. I'm running Windows Vista 64-bit.  Can anyone help?

    Is there an error message when you try to launch the iTunesSetup.exe (or iTunes64Setup.exe)? If so, what does it say? (Precise text, please.)

  • Fit the image to window width, window height and  the window size

    hi all
    here we wrote the code for "fit the image to window width, window height and the window size". we are facing some problems in it. and all these operations have to perform even after zooming operations are done.if the below code doesnt satisfy kindly provide appropriate code .
    thanks .
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import java.io.File;
    import javax.swing.filechooser.FileFilter;
    import java.awt.geom.*;
    public class DP extends JFrame implements ActionListener,
                                               MouseListener,
                                               MouseMotionListener {
        private final int PEN_OP = 1;
        private final int CLEAR_OP = 2;
        private int radius;
        private int radius1;
        private int mousex = 0;
        private int mousey = 0;
        private int prevx = 0;
        private int prevy = 0;
        private boolean initialFreeHand = true;
        private boolean initialLine = true;
        private boolean initialEraser = true;
        private int Orx = 0;
        private int Ory = 0;
        private int OrWidth = 0;
        private int OrHeight = 0;
        private int drawX = 0;
        private int drawY = 0;
        private int polyX = 0;
        private int polyY = 0;
        private int eraserLength = 5;
        private int udefRedValue = 255;
        private int udefGreenValue = 255;
        private int udefBlueValue = 255;
        private int opStatus = PEN_OP;
        private int colorStatus = 1;
        private double zoomPercentage=10;
        private Color mainColor = new Color(0, 0, 0);
        private Color xorColor = new Color(255, 255, 255);
        private Color userDefinedColor =
            new Color(udefRedValue, udefGreenValue,udefBlueValue);
        private JButton openButton = new JButton("open");
        private JButton closeButton = new JButton("close");
         private JButton zoominButton = new JButton("ZoomIn");
         private JButton zoomoutButton = new JButton("ZoomOut");
         private JButton zoomto100Button = new JButton("ZoomTo100");
         private JButton fwwButton = new JButton("Fit window width");
         private JButton fwhButton = new JButton("Fit window height");
         private JButton fwButton = new JButton("Fit the window");
        private JButton clearButton = new JButton("Clear");
        private JTextField colorStatusBar = new JTextField(20);
        private JTextField opStatusBar = new JTextField(20);
        private JTextField mouseStatusBar = new JTextField(10);
        private JPanel controlPanel = new JPanel(new GridLayout(18, 1, 0, 0));
        JToolBar jToolbar = new JToolBar();
        private Container container;
        private JScrollBar horizantalSlide=new JScrollBar();
        public BufferedImage image;
        BufferedImage bgImage;
    //    public ImageIcon icon=null;
        JFileChooser fileChooser;
        DrawPanel drawPanel = new DrawPanel(bgImage,zoomPercentage);
        public DP() {
            super("WhiteBoard");
            fileChooser = new JFileChooser(".");
            container = getContentPane();
            container.setBackground(Color.white);
            container.setLayout(new BorderLayout());
            container.add(jToolbar,BorderLayout.NORTH);
            container.add(horizantalSlide);
            jToolbar.add(openButton);
            jToolbar.add(closeButton);
              jToolbar.add(zoominButton);
              jToolbar.add(zoomoutButton);
              jToolbar.add(zoomto100Button);
              jToolbar.add(fwwButton);
              jToolbar.add(fwhButton);
              jToolbar.add(fwButton);
            jToolbar.add(clearButton);
            colorStatusBar.setEditable(false);
            opStatusBar.setEditable(false);
            mouseStatusBar.setEditable(false);
            controlPanel.setBackground(Color.white);
            drawPanel.setBackground(Color.white);
            container.add(controlPanel, "West");
            container.add(drawPanel, "Center");
            openButton.addActionListener(this);
            closeButton.addActionListener(this);
              zoominButton.addActionListener(this);
              zoomoutButton.addActionListener(this);
              zoomto100Button.addActionListener(this);
              fwwButton.addActionListener(this);
              fwhButton.addActionListener(this);
              fwButton.addActionListener(this);
            clearButton.addActionListener(this);
            drawPanel.addMouseMotionListener(this);
            drawPanel.addMouseListener(this);
            addMouseListener(this);
            addMouseMotionListener(this);
            opStatusBar.setText("FreeHand");
            colorStatusBar.setText("Black");
        public void actionPerformed(ActionEvent e) {
            if(e.getActionCommand().equals("open"))
                showDialog();
            if(e.getActionCommand().equals("close"))
                closeDialog();
              if(e.getActionCommand().equals("ZoomIn"))
                   drawPanel.zoom(1);
              if(e.getActionCommand().equals("ZoomOut"))
                   drawPanel.zoom(-1);
              if(e.getActionCommand().equals("ZoomTo100"))
                   drawPanel.zoom(+10);
              if(e.getActionCommand().equals("Fit window width"))
                   drawPanel.fitwindowwidth();
              if(e.getActionCommand().equals("Fit window height"))
                   drawPanel.fitwindowheight();
              if(e.getActionCommand().equals("Fit the window"))
                   drawPanel.fitthewindow();
            if (e.getActionCommand() == "Clear")
                opStatus = CLEAR_OP;
            switch (opStatus) {
                case CLEAR_OP:
                    clearPanel();
        private void showDialog() {
            if(fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
                File file = fileChooser.getSelectedFile();
                try {
                    bgImage = ImageIO.read(file);
                } catch(IOException e) {
                    System.out.println("IO error: " + e.getMessage());
                clearPanel();
        private void closeDialog() {
            drawPanel.setVisible(false);
            drawPanel.repaint();
        public void clearPanel() {
            opStatusBar.setText("Clear");
            Graphics g = image.getGraphics();
            g.setColor(drawPanel.getBackground());
            g.fillRect(0, 0, drawPanel.getBounds().width, drawPanel.getBounds().height);
            if(bgImage != null)
                g.drawImage(bgImage, 0, 0, this);
            g.dispose();
            drawPanel.repaint();
        public boolean mouseHasMoved(MouseEvent e) {
            return (mousex != e.getX() || mousey != e.getY());
        public void setActualBoundry() {
            if (mousex < Orx || mousey < Ory) {
                if (mousex < Orx) {
                    OrWidth = Orx - mousex;
                    drawX = Orx - OrWidth;
                } else {
                    drawX = Orx;
                    OrWidth = mousex - Orx;
                if (mousey < Ory) {
                    OrHeight = Ory - mousey;
                    drawY = Ory - OrHeight;
                } else {
                    drawY = Ory;
                    OrHeight = mousey - Ory;
            } else {
                drawX = Orx;
                drawY = Ory;
                OrWidth = mousex - Orx;
                OrHeight = mousey - Ory;
        public void setGraphicalDefaults(MouseEvent e) {
            mousex = e.getX();
            mousey = e.getY();
            prevx = e.getX();
            prevy = e.getY();
            Orx = e.getX();
            Ory = e.getY();
            drawX = e.getX();
            drawY = e.getY();
            OrWidth = 0;
            OrHeight = 0;
        public void mouseDragged(MouseEvent e) {
            updateMouseCoordinates(e);
            switch (opStatus) {}
        public void mouseReleased(MouseEvent e) {
            updateMouseCoordinates(e);
            switch (opStatus) {}
        public void mouseEntered(MouseEvent e) {
            updateMouseCoordinates(e);
        public void updateMouseCoordinates(MouseEvent e) {
            String xCoor = "";
            String yCoor = "";
            if (e.getX() < 0)
                xCoor = "0";
            else {
                xCoor = String.valueOf(e.getX());
            if (e.getY() < 0)
                xCoor = "0";
            else {
                yCoor = String.valueOf(e.getY());
            mouseStatusBar.setText("x:" + xCoor + " y:" + yCoor);
        public void mouseClicked(MouseEvent e) { updateMouseCoordinates(e); }
        public void mouseExited(MouseEvent e) { updateMouseCoordinates(e); }
        public void mouseMoved(MouseEvent e) { updateMouseCoordinates(e); }
        public void mousePressed(MouseEvent e) { updateMouseCoordinates(e); }
        public static void main(String[] args) {
            DP wb = new DP();
            wb.setDefaultCloseOperation(EXIT_ON_CLOSE);
            wb.setSize(1024,740);
            wb.setVisible(true);
        private class DrawPanel extends JPanel {
            private double m_zoom = 1.0;
            private double m_zoomPercentage;
            private BufferedImage m_image;
            double theta = 0;
            double thetaInc = Math.PI/2;
            public DrawPanel(BufferedImage imageb,double zoomPercentage) {
                m_image = imageb;
                m_zoomPercentage = zoomPercentage / 100;
            protected void paintComponent(Graphics g) {
                Graphics2D g2d=(Graphics2D)g;
                if(image == null)
                    initImage();
                g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                                     RenderingHints.VALUE_INTERPOLATION_BICUBIC);
                double x = (1.0 - m_zoom)*getWidth()/2.0;
                double y = (1.0 - m_zoom)*getHeight()/2.0;
                AffineTransform at = AffineTransform.getTranslateInstance(x, y);
                at.rotate(theta,m_zoom*getWidth()/2,m_zoom*getHeight()/2);
                at.scale(m_zoom, m_zoom);
                g2d.drawRenderedImage(image, at);
      public void zoom(int inc) {
            m_zoom += inc * m_zoomPercentage;
            repaint();
              public void fitwindowwidth()
                int w1=drawPanel.getWidth();
                int h1=drawPanel.getHeight();
                BufferedImage image2=image.getScaledInstance(w1,h1,Image.SCALE_DEFAULT);
                drawPanel.setPreferredSize(new java.awt.Dimension(100,image2.getImage().getHeight(null)));
               drawPanel.repaint();
              public void fitwindowheight()
           BufferedImage image2=image.getScaledInstance(500,680,1); 
           drawPanel.setImage(iicon);
           drawPanel.setPreferredSize(new java.awt.Dimension(100,image2.getImage().getHeight(null)));
           drawPanel.repaint();
              public void fitthewindow()
           BufferedImage image2=image.getScaledInstance(1000,680,1);
           drawPanel.setPreferredSize(new java.awt.Dimension(100,image2.getImage().getHeight(null)));
           drawPanel.repaint();
            private void initImage() {
                int w = getWidth();
                int h = getHeight();
                image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
                Graphics2D g2 = image.createGraphics();
                g2.setPaint(getBackground());
                g2.fillRect(0,0,w,h);
                g2.dispose();
    }

    thank you for giving reply.
    your code is very helpful to us.but i couldn't integrate it in my code.here's my code.
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import java.awt.image.BufferedImage;
    import java.io.*;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    import java.io.File;
    import javax.swing.filechooser.FileFilter;
    import java.awt.geom.*;
    public class IS extends JFrame implements ActionListener,
                                               MouseListener,
                                               MouseMotionListener {
        private final int PEN_OP = 1;
        private final int CLEAR_OP = 2;
         private     final int DISTORT = 3;
        private final int SCALE   = 4;
        private final int FIT     = 5;
        private final int FILL    = 6;
        int scaleMode = SCALE;
        private int radius;
        private int radius1;
        private int mousex = 0;
        private int mousey = 0;
        private int prevx = 0;
        private int prevy = 0;
        private boolean initialFreeHand = true;
        private boolean initialLine = true;
        private boolean initialEraser = true;
        private int Orx = 0;
        private int Ory = 0;
        private int OrWidth = 0;
        private int OrHeight = 0;
        private int drawX = 0;
        private int drawY = 0;
        private int polyX = 0;
        private int polyY = 0;
        private int eraserLength = 5;
        private int udefRedValue = 255;
        private int udefGreenValue = 255;
        private int udefBlueValue = 255;
        private int opStatus = PEN_OP;
        private int colorStatus = 1;
        private double zoomPercentage=10;
        private Color mainColor = new Color(0, 0, 0);
        private Color xorColor = new Color(255, 255, 255);
        private Color userDefinedColor =
            new Color(udefRedValue, udefGreenValue,udefBlueValue);
        private JButton openButton = new JButton("open");
        private JButton closeButton = new JButton("close");
         private JButton zoominButton = new JButton("ZoomIn");
         private JButton zoomoutButton = new JButton("ZoomOut");
         private JButton zoomto100Button = new JButton("ZoomTo100");
         private JButton fwwButton = new JButton("Fit window width");
         private JButton fwhButton = new JButton("Fit window height");
         private JButton fwButton = new JButton("Fit the window");
        private JButton clearButton = new JButton("Clear");
        private JTextField colorStatusBar = new JTextField(20);
        private JTextField opStatusBar = new JTextField(20);
        private JTextField mouseStatusBar = new JTextField(10);
        private JPanel controlPanel = new JPanel(new GridLayout(18, 1, 0, 0));
        JToolBar jToolbar = new JToolBar();
        private Container container;
        private JScrollBar horizantalSlide=new JScrollBar();
        public BufferedImage image;
        BufferedImage bgImage;
    //    public ImageIcon icon=null;
        JFileChooser fileChooser;
        DrawPanel drawPanel = new DrawPanel(bgImage,zoomPercentage);
        public IS() {
            super("WhiteBoard");
            fileChooser = new JFileChooser(".");
            container = getContentPane();
            container.setBackground(Color.white);
            container.setLayout(new BorderLayout());
            container.add(jToolbar,BorderLayout.NORTH);
            container.add(horizantalSlide);
            jToolbar.add(openButton);
            jToolbar.add(closeButton);
              jToolbar.add(zoominButton);
              jToolbar.add(zoomoutButton);
              jToolbar.add(zoomto100Button);
              jToolbar.add(fwwButton);
              jToolbar.add(fwhButton);
              jToolbar.add(fwButton);
            jToolbar.add(clearButton);
            colorStatusBar.setEditable(false);
            opStatusBar.setEditable(false);
            mouseStatusBar.setEditable(false);
            controlPanel.setBackground(Color.white);
            drawPanel.setBackground(Color.white);
            container.add(controlPanel, "West");
            container.add(drawPanel, "Center");
            openButton.addActionListener(this);
            closeButton.addActionListener(this);
              zoominButton.addActionListener(this);
              zoomoutButton.addActionListener(this);
              zoomto100Button.addActionListener(this);
              fwwButton.addActionListener(this);
              fwhButton.addActionListener(this);
              fwButton.addActionListener(this);
            clearButton.addActionListener(this);
            drawPanel.addMouseMotionListener(this);
            drawPanel.addMouseListener(this);
            addMouseListener(this);
            addMouseMotionListener(this);
            opStatusBar.setText("FreeHand");
            colorStatusBar.setText("Black");
        public void actionPerformed(ActionEvent e) {
            if(e.getActionCommand().equals("open"))
                showDialog();
            if(e.getActionCommand().equals("close"))
                closeDialog();
              if(e.getActionCommand().equals("ZoomIn"))
                   drawPanel.zoom(1);
              if(e.getActionCommand().equals("ZoomOut"))
                   drawPanel.zoom(-1);
              if(e.getActionCommand().equals("ZoomTo100"))
                   drawPanel.zoom(+10);
              if(e.getActionCommand().equals("Fit window width"))
                   //drawPanel.fitwindowwidth();
              drawPanel.scaleImage(0,0,0,0);
              if(e.getActionCommand().equals("Fit window height"))
              drawPanel.scaleImage(0,0,0,0);
              if(e.getActionCommand().equals("Fit the window"))
              drawPanel.scaleImage(0,0,0,0);
            if (e.getActionCommand() == "Clear")
                opStatus = CLEAR_OP;
            switch (opStatus) {
                case CLEAR_OP:
                    clearPanel();
        private void showDialog() {
            if(fileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
                File file = fileChooser.getSelectedFile();
                try {
                    bgImage = ImageIO.read(file);
                } catch(IOException e) {
                    System.out.println("IO error: " + e.getMessage());
                clearPanel();
        private void closeDialog() {
            drawPanel.setVisible(false);
            drawPanel.repaint();
        public void clearPanel() {
            opStatusBar.setText("Clear");
              int w = image.getWidth();
            int h = image.getHeight();
            Graphics g = image.getGraphics();
            g.setColor(drawPanel.getBackground());
            g.fillRect(0, 0, w, h);
            if(bgImage != null) {
                int x = (w - bgImage.getWidth())/2;
                int y = (h - bgImage.getHeight())/2;
                g.drawImage(bgImage, x, y, this);
            g.dispose();
            drawPanel.repaint();
        public boolean mouseHasMoved(MouseEvent e) {
            return (mousex != e.getX() || mousey != e.getY());
        public void setActualBoundry() {
            if (mousex < Orx || mousey < Ory) {
                if (mousex < Orx) {
                    OrWidth = Orx - mousex;
                    drawX = Orx - OrWidth;
                } else {
                    drawX = Orx;
                    OrWidth = mousex - Orx;
                if (mousey < Ory) {
                    OrHeight = Ory - mousey;
                    drawY = Ory - OrHeight;
                } else {
                    drawY = Ory;
                    OrHeight = mousey - Ory;
            } else {
                drawX = Orx;
                drawY = Ory;
                OrWidth = mousex - Orx;
                OrHeight = mousey - Ory;
        public void setGraphicalDefaults(MouseEvent e) {
            mousex = e.getX();
            mousey = e.getY();
            prevx = e.getX();
            prevy = e.getY();
            Orx = e.getX();
            Ory = e.getY();
            drawX = e.getX();
            drawY = e.getY();
            OrWidth = 0;
            OrHeight = 0;
        public void mouseDragged(MouseEvent e) {
            updateMouseCoordinates(e);
            switch (opStatus) {
        public void mouseReleased(MouseEvent e) {
            updateMouseCoordinates(e);
            switch (opStatus) {}
        public void mouseEntered(MouseEvent e) {
            updateMouseCoordinates(e);
        public void updateMouseCoordinates(MouseEvent e) {
            String xCoor = "";
            String yCoor = "";
            if (e.getX() < 0)
                xCoor = "0";
            else {
                xCoor = String.valueOf(e.getX());
            if (e.getY() < 0)
                xCoor = "0";
            else {
                yCoor = String.valueOf(e.getY());
            mouseStatusBar.setText("x:" + xCoor + " y:" + yCoor);
        public void mouseClicked(MouseEvent e) { updateMouseCoordinates(e); }
        public void mouseExited(MouseEvent e) { updateMouseCoordinates(e); }
        public void mouseMoved(MouseEvent e) { updateMouseCoordinates(e); }
        public void mousePressed(MouseEvent e) { updateMouseCoordinates(e); }
        public static void main(String[] args) {
            IS wb = new IS();
            wb.setDefaultCloseOperation(EXIT_ON_CLOSE);
            wb.setSize(1024,740);
            wb.setVisible(true);
        private class DrawPanel extends JPanel {
            private double m_zoom = 1.0;
            private double m_zoomPercentage;
            private BufferedImage m_image;
            double theta = 0;
            double thetaInc = Math.PI/2;
            public DrawPanel(BufferedImage imageb,double zoomPercentage) {
                m_image = imageb;
                m_zoomPercentage = zoomPercentage / 100;
            protected void paintComponent(Graphics g) {
                   super.paintComponent(g);
                Graphics2D g2d=(Graphics2D)g;
                if(image == null)
                    initImage();
                g2d.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                                     RenderingHints.VALUE_INTERPOLATION_BICUBIC);
                              int w = getWidth();
                    int h = getHeight();
                  int iw = image.getWidth();
                  int ih = image.getHeight();
                  if(scaleMode == SCALE) {
                double x = (w - m_zoom*iw)/2;
                double y = (h - m_zoom*ih)/2;
                AffineTransform at = AffineTransform.getTranslateInstance(x, y);
                at.rotate(theta,m_zoom*getWidth()/2,m_zoom*getHeight()/2);
                at.scale(m_zoom, m_zoom);
                g2d.drawRenderedImage(image, at);
                   else {
                scaleImage(w, h, iw, ih);
              private void scaleImage( int w, int h, int iw, int ih) {
                             Graphics2D g2d = image.createGraphics();
            double xScale = (double)w/iw;
            double yScale = (double)h/ih;
            AffineTransform at = new AffineTransform();
            if(scaleMode == DISTORT) {
                double x = (w - xScale*iw)/2;
                double y = (h - yScale*ih)/2;
                at.setToTranslation(x, y);
                at.scale(xScale, yScale);
            } else {
                double scale = (scaleMode == FIT) ? Math.min(xScale, yScale)
                                                  : Math.max(xScale, yScale);
                double x = (w - scale*iw)/2;
                double y = (h - scale*ih)/2;
                at.setToTranslation(x, y);
                at.scale(scale, scale);
            g2d.drawRenderedImage(image, at);
      public void zoom(int inc) {
            m_zoom += inc * m_zoomPercentage;
            repaint();
            private void initImage() {
                int w = getWidth();
                int h = getHeight();
                image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
                Graphics2D g2 = image.createGraphics();
                g2.setPaint(getBackground());
                g2.fillRect(0,0,w,h);
                g2.dispose();
    }

  • Nokia Lumia 520(back,windows logo and the search b...

    May  I know if the lumia 520 (Back, Windows logo and the search buttons-on the front of the device) - does it have the white lights on lighted up when in dark places or it does not have any lights at all?
    I have tried reset the phone, change the brightness to auto and restart many times still no lights on those buttons.
    Please advise if there are other lumia 520 user out there and if there is any solutions or it does not have any lights at all.
    If there is any solutions for it, please do let me know. First time user for windows phone.
    Thanks in advanced.
    Solved!
    Go to Solution.

    Those buttons are not backlit on the 520. 

  • Is there a way to adjust the color of the Finders file labels?

    is there a way to adjust the color of the Finders file labels?

    Apple has never been good with themes or finder preferences or anything like that. From a marketing and business point of view in the past I would guess they think consistency and therefore exerted brand loyalty outweighs customization, and anyone who really wants to get their own experience will be on linux anyways.
    Nowadays coverflow, expose, smartfolders, aliases and spotlight reduce the need to differentiate between multiple files on the system by a seperate indicator and a colour.

  • Java class to connect Windows server and excecuting bat file

    Hi All,
    Could some please provide or let me know how to connect windows server and executing bat file in windows box.
    All i have in hand to connect is Host name,Username and Password.
    Basically i am SOA guys and facing difficult in building class to do.
    I want to use Java code in my integration project in order to achieve the above case.
    I am using Linux OS. And i want to run Java code in Linux Box and to connect to Windows server
    Thanks in advanace
    Regards,
    Tarak.
    Edited by: Tarak on Aug 8, 2012 4:08 PM
    Edited by: Tarak on Aug 11, 2012 9:08 PM

    I'm afraid few if any of us are going to know anything more about connecting to Windows Server than you do. All I can suggest is to check if its client interface is publicly documented and try reverse engineering it from that.

  • Install 11gR2 client on Windows 7 in the Program Files (x86) folder

    Hi,
    We have a requirement to install the 11g R2 client 32bit on Windows 7 into the Program Files (x86) folder. We already have the 10g client installed into this location, and wish to keep the Oracle software in the same ORACLE_BASE location.
    The installer fails with an error INS-32010 String contains invalid characters.
    Is there a way to work around this, or are we going to have to change the ORACLE_BASE location?
    Any help or experiences shared will be greatly appreciated.
    Thanks
    Alex

    It should allow .
    The issue lies some where else
    Below is mandatory :
    Ensure that the paths you select for Oracle software, such as Oracle home paths and the Oracle base path, use only ASCII characters. Because installation owner names are used by default for some paths, this ASCII character restriction applies to user names, file names, and directory names.
    Refer
    http://download.oracle.com/docs/cd/E11857_01/em.111/e12255/oui2_manage_oracle_homes.htm#CJAEIHEE
    Edited by: KG on Apr 13, 2011 12:15 AM

  • I recorded audio with Quicktime player and the sound files won't disappear from the desktop no matter how I try to put them in the trash...

    I recorded audio with Quicktime player and the sound files won't disappear from the desktop no matter how I try to put them in the trash...tried xing out the red x, putting them in the trash...right clicking to make them disappear...nothing works...

    Just got rid of them... I closed Quicktime and was asked to delete. So I deleted them. Problem solved.

  • Forefox won't start in windows XP: I get the message that windows "cant' find the exe file" even when I click from the program file, rather than the shortcut.

    Forefox won't start in windows XP: I get the message that windows "cant' find the exe file" even when I click from the program file, rather than the shortcut.

    Delete the current Firefox shortcut on the desktop and create a new desktop shortcut via the right-click context menu on the Firefox.exe program (Send to > Desktop)

  • Netbeans IDE and the Jar file

    I can't find the jar file compiled by Netbeans anywhere. In the preferences it says the "dist" folder, but that returns nothing when I search my computer.
    I'm using the Mac OS X release, if that helps at all.

    I've just had a look at NetBeans (on a Windows machine). The jar file is not created until I choose "Build Main Project". At that point a helpful message appeared saying:To run this application from the command line without Ant, try:
    java -jar "C:\Documents and Settings\pbrockway.WXPD6OFF\WhereAmI\dist\WhereAmI.jar"The jar file also appears in the "Files" tab (under dist). There doesn't seem to be any way of running the jar file from the NetBeans IDE - or at least, I couldn't find it: others might be more knowledgable about this.

  • The installation was canceled: Install Windows: Windows cannot open the required file E:\sources\install.wim Error code: 0x80070570

    I have a Windows XP computer and accidentally formatted the C:\ Drive. I then decided to buy the Windows Vista CD installation and popped it into the CD Drive, there was a problem with the Drive so I had to move it onto a USB Drive instead(on another computer).
    When I booted my PC(C: Drive formatted) all went well until I typed in the product key and clicked next. It shows a dialog box:
    Install Windows
    Windows cannot open the required file E:\Sources\Install.wim. The file may be                                        
    corrupt or missing. Make sure all files required for installation are available, and                                                
    restart the installation. Error code: 0x80070570
    I am in urgent need of help immediately. Please help me!
    P.S. and thanks for advance for any help. Sorry for anyone with the same problem.
    PC info: HP dc5750 Small Form Factor

    It sounds like there's a problem with that file. You will need to re-copy the files to USB or even re-download the operating system from Microsoft.

  • Computer crashed, went to launch Thunderbird and the email files were gone, copied from backup and they are getting erased.

    Lost power on the computer and when it came back, went through the Windows 7 stuff and went to launch Thunderbird and the email files were gone. I copy them back from a backup to the directory and when I launch TB the tree is there in the correct order but when I click on something they all disappear. Another thing I can't do is create a directory under the host name, when I right click on the host name > New Folder > and try and create it under the host name it goes under the Inbox which is directly under the host name. If I try and drag to there I want it I get an error like the directory already exists. I still have the files/directories functioning on a laptop so not in total panic mode. Thanks
    ~Dave

    Discovered the problem, TB configured the email account as IMAP rather than POP. I went in and manually changed it to POP, copied the backup files and all better now.
    I would have deleted the original post but thought I'd post a follow up instead.
    ~Dave

  • When tring to download the download window appears and the bar moves across to complete but then the window closes and nothing is downloaded?

    # Question
    when tiring to download the download window appears and the bar moves across to complete but then the window closes and nothing is downloaded?

    Your plugins list shows outdated plugin(s) with known security and stability risks.
    *Shockwave Flash 10.0 r32
    Update the [[Flash]] plugin to the latest version.
    *http://www.adobe.com/software/flash/about/
    It is possible that your anti-virus software is corrupting the downloaded files or otherwise interfering with downloading files by Firefox.<br />
    You can try to disable the real-time (live) scanning of files in your anti-virus software temporarily to see if that makes downloading work.<br />
    Do not forget to re-enable the scanning in your anti-virus software after you are finished with downloading and installing.<br />
    See http://kb.mozillazine.org/Unable_to_save_or_download_files (Disable virus scanning in Firefox preferences - Windows)

Maybe you are looking for

  • When i open itunes on my desktop the itunes store wont open

    When i open itunes on my desktop the itunes store wont open, Ihave tried uninstalling and reinstalling but no good. I cant even sign in. System is win7 64bit if any of that helps. Thanks in advance for any help.

  • What is error code 9977652 and how to fix it?

    I can't seem to star up my computer and the error code is 9977652, how do I fix this problem? It jets stuck on the apple icon and gets overheated in no time. I am worried, please help.

  • Computer not fully starting up

    I have a PowerMac G5, and just recently my computer will start up to the gray screen, yet it will remain there, and usually around 30 seconds later, my fans start blowing like crazy. I have shut off my computer and rebooted it with several different

  • Illustrator CS4 Action Palette bug

    Does anyone know if the action palette bug has been addressed? I saw a thread from Nov 2008 that confirmed I am not an isolated incident. I can't get all the steps in my action to save when I reopen Illustrator. Particularly "show all layers". I am w

  • Error when calling FM REUSE_ALV_HIERSEQ_LIST_DISPLAY...

    Hello Experts, I am having problems using the said FM. It says MOVE_TO_LIT_NOTALLOWED_NODATA. Below is my code: CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'       EXPORTING *       I_INTERFACE_CHECK              = ' '         i_callback_program