Paint component scope issues

hi i have 2 classes one is my main and the other is the paint class with void paintcomponent() inside
how do i pass the x variable inside main class so i can use it inside the Map class
i know you can use scope e.g. Map map = new Map(x,y); but then i have to use a constructor with
its own repaint(); method inside but it does not work.
i was thinking of overloading a constructor aswell so inside one constructor is nothing and in the other with the (x, y) has
the repaint method inside but that doesn't work either.
main class
public class Main
public static void main(String[] args) {
MainFrame frame = new MainFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(500, 500);
frame.setVisible(true);
class MainFrame extends JFrame
private int x;
private int y;
// map class with paint component
Map map = new Map(x,y);
public MainFrame(){
this.add(map);
}paint class
public class Map extends JPanel {
private int x;
private int y;
public Map(){}
public Map(int x, int y){
this.x = x;
this.y = y;
repaint();
    @Override
    public void paintComponent(Graphics g){
    super.paintComponent(g);
    Graphics2D g2 = (Graphics2D)g;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
}this does not work, any ideas?
Edited by: nicchick on Nov 25, 2008 1:00 AM

um that wasnt exactly what i was looking for i have a better example
what im trying to do is pass/scope private varibles from the main class to the map class
but since you use repaint(); to call the paintcomponent override method theres no way to scope varibles like
x and y to panel?
this example shows what im trying to do with a mouselistener
main
public class Main
public static void main(String[] args) {
MainFrame frame = new MainFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setSize(500, 500);
frame.setVisible(true);
class MainFrame extends JFrame
private int x;
private int y;
// map class with paint component
Map map = new Map();
// handler
HandlerMotion handler = new HandlerMotion();
public MainFrame(){
this.add(map);
map.addMouseMotionListener(handler);
     private class HandlerMotion implements MouseMotionListener
        public void mouseDragged(MouseEvent e) {
        public void mouseMoved(MouseEvent e) {
        x = e.getX();
        y = e.getY();
        new Map(x,y);
        repaint();
}map
public class Map extends JPanel {
    private int x;
    private int y;
    public Map(){}
    public Map(int x, int y)
    this.x = x;
    this.y = y;
    System.out.println("this is map" + x);
    System.out.println("this is map" + y);
    repaint();
    @Override
    public void paintComponent(Graphics g){
    super.paintComponent(g);
    Graphics2D g2 = (Graphics2D)g;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    g2.drawLine(0, 0, x, y);
    System.out.println("this is panel" + x);
    System.out.println("this is panel" + y);
}

Similar Messages

  • JCA Binding Component connection issue in the Oracle Order Demo Application

    Hi,
    I setup the Oracle Fusion Middleware. I also deployed the Oracle Fusion Order Demo Application in the soa_server. I placed the order in the store front web.I initiated the webservice (OrderBookingService) and found the below error in the soa_server_diagnostic log file.
    =====================================================================================================================================
    Caused by: BINDING.JCA-12563
    Exception occured when binding was invoked.
    Exception occured during invocation of JCA binding: "JCA Binding execute of Reference operation 'Write' failed due to: JCA Binding Component connection issue.
    JCA Binding Component is unable to create an outbound JCA (CCI) connection.
    OrderBookingComposite:USPSShipment [ Write_ptt::Write(body) ] : The JCA Binding Component was unable to establish an outbound JCA CCI connection due to the following issue: BINDING.JCA-12510
    JCA Resource Adapter location error.
    Unable to locate the JCA Resource Adapter via .jca binding file element <connection-factory/>
    The JCA Binding Component is unable to startup the Resource Adapter specified in the <connection-factory/> element: location='eis/file/FODFileAdapter'.
    The reason for this is most likely that either
    1) the Resource Adapters RAR file has not been deployed successfully to the WebLogic Application server or
    2) the '<jndi-name>' element in weblogic-ra.xml has not been set to eis/file/FODFileAdapter. In the last case you will have to add a new WebLogic JCA connection factory (deploy a RAR).
    Please correct this and then restart the Application Server
    The invoked JCA adapter raised a resource exception.
    =====================================================================================================================================

    Thanks Guys.
    I resolved the issue.
    The issue is that FileAdapter for FulFillment mediator is missing.
    Solution 1:
    File adapter connection factory needs to be created via the weblogic console
    The details below:     
         JNDI Name: eis/file/FODFileAdapter
         controlDir          java.lang.String     /tmp/control
         inboundDataSource     java.lang.String     jdbc/SOADataSource
         outboundDataSource     java.lang.String     jdbc/SOADataSource
         outboundDataSourceLocal     java.lang.String     jdbc/SOALocalTxDataSource
         outboundLockTypeForWritejava.lang.String     oracle
    Solution 2:
    seedFodFileAdapterResources target in $FOD_HOME/bin/common-sca-tools.xml needs to be executed to create the file adaptor.
    Thanks.
    Ilayaraja

  • Scope issue?

    Folks, I have a question on scope (or at least I think it is a scope question.
    Here is what I want to do. In my game class (that manages the turns and picks a winner), I want to create either a SmartPlayer or a DumbPlayer object. Both are children of Player. My first run at this ended with a scope issue which, through your suggestions, I solved. I made some changes to the code and got past it.
    (code below) I created an Interface PlayerInt which has the required methods (I know in this simple program, I don't need an Interface, but I am trying to learn about them and inheritance, and other things. ).Then I defined a Player class, and SmartPlayer and DumbPlayer. Player has the private name variable and a setter to set the name properly. In the constructor for SmartPlayer and DumbPlayer, I call setName("the name").
    When I run the game, I declare Player computer and then instantiate a either a SmartPlayer or DumbPlayer object and assign it to Player. Howver, computer.name is null. I don't understand why it is not being set.
            Player computer = null;
            if (generator.nextInt(2) == 0){
                  computer = new SmartPlayer();
            } else {
                 computer = new DumbPlayer();
            } Thanks, in advance. Oil.
    relevant code below:
    public interface PlayerInt {
        public int takeTurn (int stones);
        public void setName(String theName);
        public String getName ();
    public class Player implements PlayerInt {
        public String getName () {
            return name;
        public void setName (String theName) {
            name = theName;
         public int takeTurn(int stones){
             return -1;
        private String name;
    public class DumbPlayer extends Player {
        public void DumbPlayer () {
            setName("Dumb Player");
    * Take a random number of stones that are less than or equal to 1/2 pile.
    * PlayerInt must take between 1 and 1/2 stones. At 3 or less, can only take 1 stone and comply with rules.
    * @param stones this is the number of stones in the pile.
    * @return returns the number of stones taken.
        public int takeTurn (int stones) {
            Random generator = new Random();
            int stonesTaken = 0;
            if (stones > 3) {
                stonesTaken = generator.nextInt((1 + stones)/2);
            } else {
                stonesTaken = 1;
            return stonesTaken;
    public class SmartPlayer extends Player {
        public void SmartPlayer() {
            setName("Smart Player");
         * PlayerInt takes a turn based on rules.
         * PlayerInt takes enough stones to make the pile 1 power of 2 less than 3, 3, 7, 15, 31, or 63 and less than 1/2 the pile.
         * If the pile is already 3, 7, 15, 31, or 63, take a random stone.
         * @param stones the number of stones left in the pile.
         * @return the number of stones taken.
        public int takeTurn (int stones) {
            int halfstones = stones/2;
            int stonesToTake = 0;
            switch (stones) {
                case 1:
                case 2:
                case 3:
                    stonesToTake = 1;
                    break;
                case 7:
                case 15:
                case 31:
                case 63:
                    Random generator = new Random();
                    stonesToTake = generator.nextInt(1 + halfstones);
                    break;
                default:
                    if (stones > 3 && stones < 7){
                        stonesToTake = stones - 3;
                    } else if (stones > 7 && stones < 15) {
                        stonesToTake = stones - 7;
                    } else if (stones > 15 && stones < 31) {
                        stonesToTake = stones - 15;
                    } else if (stones > 31 && stones < 63) {
                        stonesToTake = stones - 31;
                    }else if (stones > 63) {
                        stonesToTake = stones - 63;
            return stonesToTake;
    public class Game {
        // Let player choose to play smart vs dumb, human vs computer,
        //human vs dumb, or human vs smart.
        public void playGame() {
            Pile thePile = new Pile();
            Random generator = new Random();
            int turn = generator.nextInt(2);
            HumanPlayer human = new HumanPlayer();
            boolean foundWinner = false;
            String winner = "";
            int stonesTaken;
    // declare parent
            Player computer;
    // instantiate and assign a SmartPlayer or DumbPlayer object to Player reference.
            if (generator.nextInt(2) == 0){
                  computer = new SmartPlayer();
            } else {
                 computer = new DumbPlayer();
            if (turn == 0) {
    // Should print out either "Smart Player" or "Dumb Player"
                System.out.println(computer.getName() + " took the first turn. There are " + thePile.getNumberOfStones() + " stones in the pile.");
            } else {
                System.out.println("You take the first turn. There are " + thePile.getNumberOfStones() + " stones in the pile.");
            while (!foundWinner) {
                if (turn == 0) {
                    stonesTaken = computer.takeTurn(thePile.getNumberOfStones());
                    thePile.takeStones(stonesTaken);
                    System.out.println(computer.getName() + " took: " + stonesTaken + " stones.");
                    turn = 1;
                } else {
                    thePile.takeStones(human.takeTurn(thePile.getNumberOfStones()));
                    turn = 0;
                if (thePile.getNumberOfStones() == 0) {
                    if (turn == 0) {
                        foundWinner = true;
                        winner = human.getName();
                    } else {
                        foundWinner = true;
                        winner = computer.getName();
            }// end while
            System.out.println("The winner is " + winner + ".");
    }

    To be honest. I'd keep both interface and abstract class.
    But instead of using a reference to the abstract class use the interface instead.
    So
    PlayerInt player = null;
    //later
    player = new DumbPlayer();This is actually the "correct" way of doing this. So basically any code that uses the PlayerInt does not actually need to know what implementation is being used. In your example this is not important since you initialize it yourself but imagine you had an APIthat exposed the computer player with a method like this...
    public PlayerInt getComputerPlayer()Then other code can use this method to get a PlayerInt implementation. It won't know which one, and it won't care. And that's why this is flexible and good. Because you can add new implementations later.
    The Player abstract class is actually hidden away from most code as an implementation detail. It's not great to use abstract classes as reference types because if you want to create new implementations later among other things you've boxed yourself in to a class heirarchy. But abstract classes are good for refactoring away boilerplate code, as you have already done here. There's no point in implementing get/setName over and over again so do as you have here, create an abstract class and stick the basic implementation there.
    Anyway all this is akin to why it is preferrable (uj slings and arrows aside) to do things like
    List<String> list = new ArrayList<String>();All you care is that you have a List (interface), you don't care what implementation (ArrayList) nor do you care that there is an abstract class (or two) that ArrayList extends.

  • JCA Binding Component connection issue - Help plz

    All,
    soa - 11.1.1.3
    I configured a async BPEL which reads data from DB (using DBAdapter) and write to a file. I'm getting the following error frequently. But same BPEL if I test it after few minutes it works, its very intermittent. Any clue?
    I checked the DB which is installed locally, its up and running. No issue i seen in the DB.
    Caused by: BINDING.JCA-12511
    JCA Binding Component connection issue.
    JCA Binding Component is unable to create an outbound JCA (CCI) connection.
    *OutOrderRequestMap:TerritoryPull [ TerritoryPull_ptt::TerritoryPull(TerritoryPullInput_msg,TerritoryPullOutputCollection) ] : The JCA Binding Component was unable to establish an outbound JCA CCI connection due to the following issue: javax.resource.spi.IllegalStateException: [Connector:199176]Unable to execute allocateConnection(...) on ConnectionManager. A stale Connection Factory or Connection Handle may be used. The connection pool associated with it has already been destroyed. Try to re-lookup Connection Factory eis/DB/orafin11i from JNDI and get a new Connection Handle.*
    Thanks,
    sen

    Are you using JDBC Xa datasource ? Try following the steps defined in this forum link @ Re: Error at the time of Invocation of DB Adapter

  • Paint component inside JPanel

    Hi guys,
    I will start with the original problem and get to the only option that seems possible before hardcoding everything.
    I need to draw something like a binary tree. Jtree doesn't fall into binary because it does not have the root in the center. <1;2;6;8;9>, where 6 is the root, and 1,2 are its left child's children and 8,9 are right child's children. Since I couldn't find any possible solution of customizing JTree to draw it in binary format, I am left with the following option that is a step towards hardcoding.
    Create a subclass of JPanel and paint inside it. The full hardcode method would be to draw everything right here, ie the lines and the boxes.
    But since I need to listen to box selections using mouse, I was hoping to draw the boxes using JPanel/JLabel and override their paint() method.
    So is there a way to paint components(JLabel/JPanel and lines) into a painted component (JPanel)? Note, the container JPanel is not using any layout. everything is being drawn using paint method.

    You are probably going to want to create smaller objects that handle their own painting. For example... Create an extension of JComponent that handles painting a single node. Then create the JPanel to add those to. You can even go as far as writing your own LayoutManager to handle laying the Components out in your binary layout. This is really the most effective way to do it, especially if you want to be able to detect clicks and what not. You can just add MouseListener's to the individual components than.
    Hope this helps,
    Josh Castagno
    http://www.jdc-software.com

  • Paint Component

    Hi all
    i have four classes plot , plot3d, plotsurface and test
    plot is derived from JPanel and plot3d and plotsurface extend plot class
    i am trying to do a very simple operation . just making a tool bar with 2 buttons to switch between plots .
    the 2 plot classes plot3d and plotsurface just draw a line on the screen
    problem is that when the user clicks one button it doesnot show up on the screen but when the window is resized it does call paint component of the corresponding class
    can Any one explain why this is happening......
    package test;
    import javax.swing.*;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    public abstract class plot extends JPanel {
    plot()
    public void paintComponent(Graphics g)
    Graphics2D graphics2D=(Graphics2D)g;
    super.paintComponent(g);
    package test;
    import javax.swing.*;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    public class plot3d extends plot {
    plot3d(boolean resizable)
    public void paintComponent(Graphics g)
    Graphics2D graphics2D=(Graphics2D)g;
    super.paintComponent(g);
    graphics2D.drawLine(200,200,320,320);
    package test;
    import javax.swing.*;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    public class plotsurface extends plot {
    plotsurface(boolean resizable)
    public void paintComponent(Graphics g)
    Graphics2D graphics2D=(Graphics2D)g;
    super.paintComponent(g);
    graphics2D.drawLine(120,120,140,140);
    package test;
    import java.awt.*;
    import javax.swing.*;
    import java.awt.Graphics2D.*;
    import java.applet.*;
    public class Test extends javax.swing.JApplet {
    private Container container;
    public Rectangle rect;
    JPanel toolBar;
    JButton contourButton;
    JButton surfaceButton;
    JPanel toolPanel;
    public Graphics g;
    public test.plot3d graph3D;
    public test.plotsurface graphSurface;
    private int plotType=0;
    private void graph3D(Graphics2D g2)
    graph3D=new plot3d(false);
    public void graphSurface(Graphics2D g2)
              graphSurface=new plotsurface(false);
    private void changeplottoContour()
    if(plotType==0)
    return;
    plotType=0;
    g=container.getGraphics();
    Graphics2D g2=(Graphics2D)g;
    container.removeAll();
    repaint();
    graphSurface=null;
    System.gc();
    graph3D(g2);
    container.add(toolPanel,BorderLayout.NORTH);
    container.add(graph3D,BorderLayout.CENTER);
    private void changeplottoSurface()
    if(plotType==1)
    return;
    plotType=1;
    g=container.getGraphics();
    Graphics2D g2=(Graphics2D)g;
    container.removeAll();
    repaint();
    graph3D=null;
    System.gc();
    graphSurface(g2);
    container.add(toolPanel,BorderLayout.NORTH);
    container.add(graphSurface,BorderLayout.CENTER);
    private void surfaceButtonActionPerformed(java.awt.event.ActionEvent evt)
         changeplottoSurface();
         repaint();
    private void contourButtonActionPerformed(java.awt.event.ActionEvent evt)
         changeplottoContour();
         repaint();
    public void init()
         container=getContentPane();
    g=container.getGraphics();
    Graphics2D g2=(Graphics2D)g;
    Rectangle r1= new Rectangle();
    rect=new Rectangle();
    //r1=container.getBounds();
    toolPanel= new JPanel(new BorderLayout());
    toolBar = new JPanel();
    contourButton = new JButton("Contour");
    toolBar.add(contourButton);
    contourButton.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    contourButtonActionPerformed(evt);
    surfaceButton = new JButton("Surface Plot");
    toolBar.add(surfaceButton);
    surfaceButton.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    surfaceButtonActionPerformed(evt);
    toolBar.setBackground(Color.white);
    toolPanel.add(toolBar,BorderLayout.NORTH);
    container.add(toolPanel,BorderLayout.NORTH);
    Rectangle r2= toolPanel.getBounds();
    Dimension appletSize = this.getSize();
    int appletHeight= appletSize.height;
    int appletWidth= appletSize.width;
              rect.setBounds(0,(int)r2.getHeight(),appletWidth,appletHeight-(int)r2.getHeight());
    plotType=0;
         graph3D(g2);
         container.add(graph3D,BorderLayout.CENTER);

    in your button action listeneres (e.g. contourButtonActionPerformed()) don't only call repaint(), but update(this.getGraphics());
    this should help in most cases. other refreshing methods are:
    java -Dsun.java2d.noddraw=true HelloWorld
    java.awt.Component.repaint()
    java.awt.Component.update(Graphics) (e.g. c.update(c.getGraphics());)
    java.awt.Component.validate()
    javax.swing.JComponent.revalidate()
    javax.swing.JComponent.updateUI()
    javax.swing.SwingUtilities.updateComponentTreeUI(java.awt.Component)

  • Object Graphics deleted on paint component

    Hello everybody!
    I have a question about the object graphics when paint a component in it. I'm trying to paint a component in a image, and after show it in the screen.
    The problem is that in order to make it possible, I have to put the function that paint the image inside the code paint() of the principal class.
    With this code in one class named: Program:
    public void paint(Graphics g){
    Graphics2D g2 = (Graphics2D) g.create();      
                gt = new GraphicT(view);   <-HERE IS THE PROBLEM
                g2.setColor(getBackground());
                g2.fillRect(0,0,getWidth(),getHeight());                               
                g2.drawImage(gt.getImage(), 0, 0, this);
    ...and with this other in other named: GraphicT:
    private JComponent view;
    private Image image;
    private Graphics gaux;
    public GraphicT(JComponent view){
            this.view = view;
            this.image = new BufferedImage (view.getWidth(),view.getHeight(),BufferedImage.TYPE_INT_BGR);
            gaux = image.createGraphics();
          //  gaux=image.getGraphics();
            this.view.paint(gaux);       
    public BufferedImage getImage(){              
            return this.image;
    ...I don't want to do it because each time that Program paint , create the image (object) in GraphicT. I want to create the image only one time, I mean to put the class GraphicT inside the Program like a object private. But if I do this, program doesn't paint anything.
    Do you know why about this behaviour?
    Thanks everybody
    Edited by: ginnkk on Feb 5, 2009 3:15 AM

    So you want to paint a component to an image and display the image. The reason it works if you put it in the paint() method is becasuse by that time the component has already been made displayable, approprietly sized, and consequently can be painted.
    If all you are doing is painting an ordinary JComponent, then it's the approprietly sized part that matters.
    Dimension prefSize = myJComponent.getPreferredSize();
    myJComponent.setSize(prefSize.width,prefSize.height);
    myJComponent.doLayout();
    GraphicT gt = new GraphicT(myJComponent);This is more or less the code required to paint the component outside the paint method right after the JComponent has been constructed.

  • Pulseaudio and systemd --user: DBus scope issues?

    Hi,
    I have a multi-seat setup, so I need user-wide pulseaudio and whatnot. I'm trying to setup my boot through systemd --user.
    Testing audio working apps are firefox, mpv, and mpd. The problem is:
    - If I start pulseaudio and mpd manually everything is fine (no use of systemd)
    - If I start pulseaudio through systemd no application has sound.
    - If I start pulseaudio and mpd through systemd only mpd has sound.
    raimundoyamtech~$ cat .config/systemd/user/pulseaudio.service
    [Unit]
    Description=PulseAudio Sound System
    After=sound.target
    [Service]
    ExecStart=/usr/bin/pulseaudio
    [Install]
    WantedBy=multi-user.target
    raimundoyamtech~$ cat .config/systemd/user/mpd.service
    [Unit]
    Description=Music Player Daemon
    After=network.target sound.target
    [Service]
    ExecStart=/usr/bin/mpd %h/.config/mpd/mpd.conf --no-daemon
    ExecStop=/usr/bin/mpd %h/.config/mpd/mpd.conf --kill
    Restart=always
    [Install]
    WantedBy=multi-user.target
    If I add BusName=org.pulseaudio.Server to the pulseaudio.service nothing changes.
    Using pulseaudio's autospawn=yes leads to what seems to be same behaviour: mpd by systemd starts pulseaudio and is the only app with sound.
    ./config/pulse/client.conf only contains default-sink. Everything else is default.
    Using alsa alone is not an option because of firefox.
    Any thoughts?
    EDIT:
    raimundoyamtech~$ systemctl --version
    systemd 208
    +PAM -LIBWRAP -AUDIT -SELINUX -IMA -SYSVINIT +LIBCRYPTSETUP +GCRYPT +ACL +XZ
    raimundoyamtech~$ pulseaudio --version
    pulseaudio 4.0
    Last edited by Raimundo (2013-10-23 10:08:13)

    ewaller wrote:
    Please do not bump.   I understand the frustration; really, I do.  But, these are very active forums with some very good technical people lurking about.  I guarantee your post had been read.  I read it.  I did not have an answer, as I have never seen that behavior afore.   I am certain that was true for many other regulars.
    In the future, you can bring focus to a thread by providing more information..  Tell us what you have tried, what you have read since the last post, etc.  At least it gives the impression that you are working the problem rather than merely waiting for a response.
    I don't know almost anything about systemd, especially because it changes so rapidly and documention is so scarce and outdated that either I read the whole documentantion for my version in hopes of finding my problem (something for which I do not have time) or post a topic.
    I posted everything I touched regarding systemd since the installation of my system, that's all the relevant information I know I can give, so at this point I had no more info to give.
    Actually posting a topic is really my last resort, it usually means that I have already tried everything I knew and I'm hopeless already.
    raimundoyamtech~$ loginctl list-sessions
    SESSION UID USER SEAT
    2 1002 carla seat0
    1 1000 raimundo seat0
    2 sessions listed.
    raimundoyamtech~$ loginctl show-session 1
    Id=1
    Timestamp=Tue 2013-10-29 12:33:47 WET
    TimestampMonotonic=6670234
    VTNr=1
    TTY=tty1
    Remote=no
    Service=login
    Scope=session-1.scope
    Leader=1456
    Audit=1
    Type=tty
    Class=user
    Active=no <----- Is this what you are talking about?
    State=online
    IdleHint=yes
    IdleSinceHint=1383050072367636
    IdleSinceHintMonotonic=0
    Name=raimundo
    raimundoyamtech~$ loginctl show-session 2
    Id=2
    Timestamp=Tue 2013-10-29 12:33:47 WET
    TimestampMonotonic=6667439
    VTNr=2
    TTY=tty2
    Remote=no
    Service=login
    Scope=session-2.scope
    Leader=1453
    Audit=2
    Type=tty
    Class=user
    Active=no <----- Is this what you are talking about?
    State=online
    IdleHint=yes
    IdleSinceHint=1383050025387636
    IdleSinceHintMonotonic=0
    Name=carla
    raimundoyamtech~$ loginctl show-session 3
    Failed to issue method call: No such file or directory
    What is an active session? Oo Never heard of it
    I could start things. Pulseaudio started, so did mpd. I also have a /usr/lib/systemd/systemd --user process started for each user. I assumed this would be it since this
    raimundoyamtech~$ systemctl --user
    Failed to issue method call: Process /bin/false exited with status 1
    always happens and I've read that systemctl --user is no longer required.
    [EDIT]
    Fixed it. Don't remember where I read that it wasn't required, just that it was in the same place I found someone else complaining about getting this error.
    For anyone else encountering this: sed -i s/system-auth/system-login/g /etc/pam.d/systemd-user
    and systemctl --user will work. Insults fly out to the one who wrote it wasn't required!
    Still am not able to get an active session though
    [/EDIT]
    Why would there be a need for anything else? I'm gonna check on that. Thanks!
    See, the bump worked ^^ but ok I'll try to refrain from doing that next time. Sorry.
    Last edited by Raimundo (2013-10-29 16:27:55)

  • Component Monitoring Issue: Message: Unable to log on to system XYZ

    Hi,
    I have installed PI 700 with SID ABC and configured with R/3 system SID XYZ.
    Now while checking Component Monitoring-->Integration Engines--->Proxy Runtime XYZ I am getting following error.
    Message: Unable to log on to system XYZ in language en with user PIRWBUSER
    Stacktrace:
    com.sap.aii.rwb.exceptions.OperationFailedException: Unable to log on to system ID6 in language en with user PIRWBUSER
    at com.sap.aii.rwb.core.XIAbapRTCComponent.getConnector(XIAbapRTCComponent.java:114)
    at com.sap.aii.rwb.core.XIRTCComponent.selftest(XIRTCComponent.java:303)
    at com.sap.aii.rwb.web.componentmonitoring.model.CompTestModel.doSelftest(CompTestModel.java:608)
    at com.sap.aii.rwb.web.componentmonitoring.viewcontroller.CmDynPage.doSelftest(CmDynPage.java:304)
    at com.sap.aii.rwb.web.componentmonitoring.viewcontroller.CmDynPage.updateTests(CmDynPage.java:375)
    at com.sap.aii.rwb.web.componentmonitoring.viewcontroller.CmDynPage.selectNode(CmDynPage.java:388)
    at com.sap.aii.rwb.web.componentmonitoring.viewcontroller.CmDynPage.process_treeClick(CmDynPage.java:339)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:324)
    And if I create user PIRWBUSER in my R/3 system XYZ, I get different kind of error.
    Details for 'Can the SLD be reached?'
    SLD ping gets exception: Error when opening an RFC connection 
    Under Message Monitoring below is the error:
    com.sap.aii.utilxi.misc.api.UnexpectedException: Internal Error: An unexpected error occurred (java.lang.NullPointerException: null)
    Can anyone have a look and guide me how to resolve this issue.
    Thanks & Regards,
    Manish

    Hi Prateek,
    I have already created PIRWBUSER in my R/3 system as I have mentioned in my first post. After that I am getting error for Proxy Runtime XYZ as below:
    Result of Self-Test
        Can the SLD be reached?  (Failed) ... Details 
        Does the Integration Engine know the business system?   ... Details  (Successful)
        Are roles in SXMS_CONF_ITEMS and SLD consistent?   ... Details  (Successful)
        Has an Integration Server destination been defined?   ... Details  (Successful)
    Details for 'Can the SLD be reached?'
    SLD ping gets exception: Error when opening an RFC connection 
    What else I have to do in this case?
    Thanks & Regards,
    Manish

  • Variable scope issue - EWS

    Hi everyone,
    So I have a funny issue. From line 8 to line 37 I declare a set of variables, most of them with null values. Then I call a function: SetupEWSAndFolder (line 88) which sets a lot of these variables. Once the function exits, the variables are empty.
    How come ? I thought that variables defined at script level would be updated in child functions ? Is it because of the null value ? I have another script with the same kind of setup but the variables are not set to null and it works perfectly fine.
    And for the fun, i tested echoing the value at the end of the function of some variables and then outside and the one outside are not updated
    I also tested using: $global:mb for instance, I still have the initial value set in the script and not the one updated in the function
    Thanks for helping me clear up my misunderstanding of the issue
    Olivier
    # Using Export - Import would be easier but since we do not have the rights for it and it requires a specific role being assigned to us... here goes EWS!!!
    # Include the Exchange Web Service DLL
    Import-Module -Name "C:\Program Files\Microsoft\Exchange\Web Services\2.0\Microsoft.Exchange.WebServices.dll"
    # Import the logwrite ability
    . .\LogWrite.ps1
    ################################################### INITIAL VARIABLES SETUP ###################################################
    #Setting up the log file
    #$userLogon = $args[0]
    $userLogon = "olivraga"
    $Logfile = "$userLogon.log"
    #setting up the name of the top folder in which to transfer #Inbox#, #SentItems#, #DeletedItems#
    $folderName = "_AutoOffBoardingArchiveFolder"
    #get the current username
    $credUserName = Get-Content env:username
    #Setting the mailbox variable for the folder binds in EWS
    $mailbox = $null
    #Setting up the Exchange Web Services connection
    $ExchangeVersion = [Microsoft.Exchange.WebServices.Data.ExchangeVersion]::Exchange2010_SP2
    $service = New-Object Microsoft.Exchange.WebServices.Data.ExchangeService($ExchangeVersion)
    $mb = $null
    #Setting up the folder variables for general calls
    $rootFolderID = $null
    $topFolder = $null
    $iFolder = $null
    $dFolder = $null
    $sFolder = $null
    #Setting up the folder ID to the targetted mailbox
    #(otherwise we would target the mailbox of the current account which we do not want :))
    $inboxID = $null
    $deletedItemsID = $null
    $sentItemsID = $null
    #Setting up the #Inbox# , #SentItems# , #DeletedItems# folder variables
    $inbox = $null
    $deletedItems = $null
    $sentItems = $null
    ############################ Function that moves a folder to another folder, including sub folders ############################
    function MoveItems(){
    $source, $dest, $path = $args[0]
    LogWrite "Copying/Moving $path"
    #Pulls items by thousands at a time
    $ivItemView = New-Object Microsoft.Exchange.WebServices.Data.ItemView(1000)
    $fiItems = $null
    do{
    #Get the 1000 items present in the source folder
    $fiItems = $service.FindItems($source.Id,$ivItemView)
    foreach($Item in $fiItems.Items){
    # Copy the Message
    $Item.Copy($dest.Id) | out-null
    # If you want to switch to a move instead use:
    #$Item.Move($dest.Id)
    $ivItemView.Offset += $fiItems.Items.Count
    }while($fiItems.MoreAvailable -eq $true)
    #Do the subfolders now
    if ($source.ChildFolderCount -gt 0)
    # Deal with any subfolders first
    $folderView = New-Object Microsoft.Exchange.WebServices.Data.FolderView(1000)
    $foldersFound = $source.FindFolders($folderView)
    ForEach ($subFolder in $foldersFound.Folders)
    $subFolderToCreate = New-Object Microsoft.Exchange.WebServices.Data.Folder($service)
    $subFolderToCreate.DisplayName = $subFolder.DisplayName
    $subFolderToCreate.Save($dest.Id)
    MoveItems($subFolder, $subFolderToCreate, $path+"\"+$subFolder.DisplayName)
    ################################# Initial necessary setup like full access and EWS connection #################################
    function SetupEWSAndFolder(){
    $mailbox = (Get-ADUser $userLogon -Properties mail).mail
    # Giving the current account Full Access to the Mailbox
    Add-MailboxPermission -Identity $mailbox -User $credUserName -AccessRights FullAccess -InheritanceType All -Confirm:$false
    $service.Url = "https://webmail.brookfieldrenewable.com/EWS/Exchange.asmx"
    #$service.Credentials = new-object Microsoft.Exchange.WebServices.Data.WebCredentials($userLogon,$userPassword,"hydro")
    #$service.Credentials = $creds.GetNetworkCredential()
    $service.UseDefaultCredentials = $true
    $service.AutodiscoverUrl($mailbox)
    $mb = new-object Microsoft.Exchange.WebServices.Data.Mailbox("$mailbox")
    #Get the root folder ID of the targetted mailbox
    $rootFolderID = new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::msgfolderroot, $mb)
    #Create new top folder to contain the Inbox, DeletedItems and SentItems folder
    $topFolder = new-object Microsoft.Exchange.WebServices.Data.Folder($service)
    $topFolder.DisplayName = "$folderName"
    $topFolder.Save($rootFolderID)
    #Create the subfolders to the topFolder to copy or move the emails in #Inbox# , #SentItems# , #DeletedItems#
    $iFolder = new-object Microsoft.Exchange.WebServices.Data.Folder($service)
    $iFolder.DisplayName = "Inbox"
    $iFolder.Save($topFolder.Id)
    $sFolder = new-object Microsoft.Exchange.WebServices.Data.Folder($service)
    $sFolder.DisplayName = "SentItems"
    $sFolder.Save($topFolder.Id)
    $dFolder = new-object Microsoft.Exchange.WebServices.Data.Folder($service)
    $dFolder.DisplayName = "DeletedItems"
    $dFolder.Save($topFolder.Id)
    #Just to make sure that the folder is created and everything is updated nicely
    Start-Sleep 5
    $inboxID = new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::Inbox,$mb)
    $deletedItemsID = new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::DeletedItems,$mb)
    $sentItemsID = new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::SentItems,$mb)
    $inbox = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($service, $inboxID )
    $deletedItems = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($service, $deletedItemsID)
    $sentItems = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($service, $sentItemsID)
    SetupEWSAndFolder #setup the EWS connections and the folders
    MoveItems ($inbox, $iFolder, "Inbox") #Copy (not move yet) Inbox to the archive folder
    MoveItems ($deletedItems, $dFolder, "DeletedItems") #Same but for deleted items
    MoveItems ($sentItems, $sFolder, "SentItems") #Same but for sent items
    ##################################################### Helper Code Blocks ######################################################
    <#
    #Block of code in case one does not know the ID of the folder, but since we just created the topFolder, we do not need to search for it :)
    #Bind to the MSGFolder Root
    $rootFolderId = new-object Microsoft.Exchange.WebServices.Data.FolderId([Microsoft.Exchange.WebServices.Data.WellKnownFolderName]::MsgFolderRoot,"hydro\$userLogon")
    #Setup the retrieval of the folder ID just created
    $targetFolder = [Microsoft.Exchange.WebServices.Data.Folder]::Bind($service,$rootFolderId)
    $searchFilter = new-object Microsoft.Exchange.WebServices.Data.SearchFilter+IsEqualTo([Microsoft.Exchange.WebServices.Data.FolderSchema]::DisplayName,$folderName)
    $folderView = new-object Microsoft.Exchange.WebServices.Data.FolderView(1)
    $findFolderResults = $service.FindFolders($rootFolderId, $searchFilter, $folderView)
    #>

    When you read the about_scope you see:
            - An item you include in a scope is visible in the scope in which it
              was created and in any child scope, unless you explicitly make it
              private. You can place variables, aliases, functions, or Windows
              PowerShell drives in one or more scopes.
    To me, it means that if you define a variable at the script level, it is going to be availble at the function level. To me, the function scope level is a child of the script scope level.
    So I did a check and it works like you say. But it is annoying, look at the following script and result:
    #This is a scope test:
    $nbErrors = "script";
    Function DoErrorTest(){
    $nbErrors
    $nbErrors = "inside"
    $nbErrors
    DoErrorTest
    $nbErrors
    Result:
    script
    inside
    script
    Which logical and totally annoying at the same time. And, to me, it means that you can never assign a value in a child scope by using the name of the variable. But you can display the value of the parent scope variable as long as you don't give a value to
    a same name variable in a child scope....
    This is gonna be annoying...
    Thanks

  • Paint from a paint(Component) method? Is it possible?

    Hi all
    Here's my deal: I'd like to make a Paint (http://java.sun.com/javase/6/docs/api/java/awt/Paint.html) out of a component or even better, just something with a paint(Graphics) method. I looked into implementing my own Paint, but it looks very foreboding, esp the requirement to be able to get the Raster in the PaintContext object which I think I'd have to implement too.
    Any advice?

    Here's my attempt at it...
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Paint;
    import java.awt.PaintContext;
    import java.awt.Rectangle;
    import java.awt.RenderingHints;
    import java.awt.geom.AffineTransform;
    import java.awt.geom.Rectangle2D;
    import java.awt.image.BufferedImage;
    import java.awt.image.ColorModel;
    import java.awt.image.Raster;
    import javax.swing.JComponent;
    import javax.swing.JFrame;
    import java.lang.reflect.Method;
    public class ImagePaint implements Paint {
        Object paintable;
        Method paintMethod;
        BufferedImage paint;
        public ImagePaint(Object paintable) {
            this.paintable = paintable;
            try{
                paintMethod =
                        paintable.getClass().getMethod("paint",Graphics.class);
            }catch(java.lang.NoSuchMethodException e) {
                throw new IllegalArgumentException("Paintable object does " +
                        "not have paint method!");
        public java.awt.PaintContext createContext(ColorModel cm,
                                                   Rectangle deviceBounds,
                                                   Rectangle2D userBounds,
                                                   AffineTransform xform,
                                                   RenderingHints hints) {
            /*the bounds being passed to this method is the bounding rectangle
             *of the shape being filled or drawn*/
           paint = new BufferedImage(deviceBounds.width,
                                     deviceBounds.height,
                                     BufferedImage.TYPE_3BYTE_BGR);
               /*note: if translucent/transparent colors are used in the
                *paintable object's "paint" method then the BufferedImage
                *type will need to be different*/
            Graphics2D g = paint.createGraphics();
                /*set the clip size so the paintable object knows the
                 *size of the image/shape they are dealing with*/
            g.setClip(0,0,paint.getWidth(),paint.getHeight());
            //call on the paintable object to ask how to fill in/draw the shape
            try {
                paintMethod.invoke(paintable, g);
            } catch (Exception e) {
                throw new RuntimeException(
                   "Could not invoke paint method on: " +
                        paintable.getClass(), e);
            return new ImagePaintContext(xform,
                                         (int) userBounds.getMinX(),
                                         (int) userBounds.getMinY());
        public int getTransparency() {
            /*Technically the transparency returned should be whatever colors are
             *used in the paintable object's "paint" method.  Since I'm just
             *drawing an opaque cross with this aplication, I'll return opaque.*/
            return java.awt.Transparency.OPAQUE;
        public class ImagePaintContext implements PaintContext {
            AffineTransform deviceToUser;
            /*the upper left x and y coordinate of the where the shape is (in
             *user space)*/
            int minX, minY;
            public ImagePaintContext(AffineTransform xform, int xCoor,
                                                            int yCoor){
                try{
                    deviceToUser = xform.createInverse();
                }catch(java.awt.geom.NoninvertibleTransformException e) {}
                minX = xCoor;
                minY = yCoor;
            public Raster getRaster(int x, int y, int w, int h) {
                /*find the point on the image that the device (x,y) coordinate
                 *refers to*/
                java.awt.geom.Point2D tmp =
                        new java.awt.geom.Point2D.Double(x,y);
                if(deviceToUser != null) {
                    deviceToUser.transform(tmp,tmp);
                }else{
                    tmp.setLocation(0,0);
                tmp.setLocation(tmp.getX()-minX,tmp.getY()-minY);
                /*return the important portion of the image/raster in the
                 * coordinate space of the device.*/
                return paint.getRaster().createChild((int) tmp.getX(),
                                                     (int) tmp.getY(),
                                                     w,h,x,y,null);
            public ColorModel getColorModel() {
                return paint.getColorModel();
            public void dispose() {
                paint = null;
        public static void main(String[] args) {
            /*as of java 1.6.10 d3d is enabled by default.  The fillRect
             * commands are significantly slower with d3d.  I think this is
             * a known bug.  Also, with d3d enabled I get all sort
             * weird painting artificats for this particular demonstration*/
            System.setProperty("sun.java2d.d3d","false");
            final ImagePaint paint = new ImagePaint(new Object() {
                public void paint(Graphics g) {
                    Rectangle r = g.getClipBounds();
                    g.setColor(Color.white);
                    g.fillRect(r.x,r.y,r.width,r.height);
                    //draw a red cross
                    g.setColor(Color.red);
                    g.fillRect(r.width/2-20,0,40,r.height);
                    g.fillRect(0,r.height/2-20,r.width,40);
                    g.dispose();
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            JComponent p = new JComponent() {
                public void paintComponent(Graphics g) {
                    Graphics2D g2d = (Graphics2D) g;
                    g2d.setPaint(paint);
                    g2d.fillOval(getWidth()/3,getHeight()/3,
                                 getWidth()/3,getHeight()/3);
                    g2d.dispose();
            p.setPreferredSize(new Dimension(500,500));
            f.setContentPane(p);
            f.pack();
            f.setVisible(true);
    }I don't think the unresponsiveness from larger areas is necessarily due to your code. For all of my GUI applications, resizing an
    already large frame tends to be prety sucky while resizing an already small frame tends to be pretty smooth.

  • Cannot display view BP_HEAD/BPHEADOverview of UI Component BP_HEAD issue

    Dear all, I am facing a strange issue in CRM 7.0 web-UI.
    I have created an attribute set with attributes and was trying to assign this to an Individual account.
    The moment I click on "Marketing Attributes" assignment block, I face the following error message:
    Cannot display view BP_HEAD/BPHEADOverview of UI Component BP_HEAD
    An exception has occurred Exception Class  CX_BSP_WD_INCORRECT_IMPLEMENT - Window 'BP_DATA/MarketingAttributesEOVPList' is not defined in the component 'BP_DATA' 
    Method:  CL_BSP_WD_COMPONENT_USAGE=>GET_INTERFACE_VIEW_CONTR 
    Source Text Row:  28
    Window MainWindow of UI Component BP_HEAD cannot be displayed
    An exception has occurred Exception Class  CX_BSP_WD_RUNTIME_ERROR - View BP_DATA.BP_DATA/MarketingAttributesEOVPList in component BP_HEAD could not be bound 
    Method:  CL_BSP_WD_VIEW_CONTROLLER=>BIND_VIEW 
    Source Text Row:  165
    I tried with many different business roles but always faced the same problem.
    Consequently, I had to logon using GUI, open tcode BP and assign the marketing attributes.
    After that, when I try to login in web-UI, I face the same issue again.
    Tried to search in Forums but couldn't get a relevant situation. So please suggest if you have any solution.

    Hi Animesh,
    Please check the runtime repository for the component bp_data. In the component Interface, add the window 'BP_DATA/MarketingAttributesEOVPList'. This should resolve your problem.
    Regards,
    Radhika

  • ADF  graph component rendering issues

    The ADF based application that we are developing requires the use of gauge component to display in data graphical representation. After it is being rendered, we have found that the graph displayed has following issues with different test scenarios..
    Let me explain the issues as following..
    1. Incorrect scaling along Y-axis when the max value is set to 2 and min value 0 and value 2. The graph scaling generated as(0, 0, 1, 2, 2). I would like to mention that data passed to graph are at runtime and this is one of the specific case when I have wrong representaion on the graph. Following is the code excerpt of the graph component implemented in the code
    <dvt:gauge id="gauge2"
    gaugeType="VERTICALSTATUSMETER"
    imageFormat="FLASH"
    maxValue="#{weightGaugeMaxValue}"
    minValue="0"
    value="#{weightGaugeBookings>0?weightGaugeBookings:-1}"
    contentDelivery="immediate"
    visualEffects="NONE"
    imageHeight="#{gaugeImageHeight}"
    inlineStyle="width:25px;">
    Please find the image of the rendered page [ here|http://img571.imageshack.us/img571/1650/scalingissue.png]
    2. When the scaling is above 1000 along Y-axis, the min value(i.e "0") is at the same level as the starting position of histogram bar but in case if it less than min value of scaling is bit up from the starting position the histogram bar.
    Please find the image of the rendered page here .
    Please let me know if you need further information to provide any suggestions to resolve the issues.
    Thanks
    Soumen

    Hi Luis,
    It is possibel to sue DVT Graph in a Java client application. For documentation, you would have to use DVT Javadoc to call java methods on oracle.dss.graph.Graph class.
    I can send you some sample apps off-line if you contact me: katarina obradovic at oracle.
    Hope this helps
    Katia

  • Paint Component using scaled Graphics with TiledImage

    Hello,
    I am in the process of adding minor image manipulation in an application I created. I have paint overridden on the component that displays the image and in that component I am scaling the graphics to a representation of the image at 300 dpi versus the screen resolution. The image is a TiledImage which gave me pretty good performance benefits when I was painting at screen resolution. Now I want to know if there is something I can do to the tiles to get the performance benefit back. I understand this
    may not be possible because the entire image displays at once with the scaled graphics instance.
    Here is a copy of my paint method:
    public void paintComponent(Graphics gc) {
              Graphics2D g = (Graphics2D) gc;
              g.scale(scale, scale);
              Rectangle rect = this.getBounds();
              rect.width *= (1/scale);
              rect.height *= (1/scale);
              if ((viewerWidth != rect.width) || (viewerHeight != rect.height)) {
                   viewerWidth = rect.width;
                   viewerHeight = rect.height;
              setDoubleBuffered(false);
              g.setColor(Color.BLACK);
              g.fillRect(0, 0, viewerWidth, viewerHeight);
              if (displayImage == null)     return;
              int ti = 0, tj = 0;
              Rectangle bounds = new Rectangle(0, 0, rect.width, rect.height);
              bounds.translate(-panX, -panY);
              int leftIndex = displayImage.XToTileX(bounds.x);
              if (leftIndex < ImageManip.getMinTileIndexX())
                   leftIndex = ImageManip.getMinTileIndexX();
              if (leftIndex > ImageManip.getMaxTileIndexX())
                   leftIndex = ImageManip.getMaxTileIndexX();
              int rightIndex = displayImage.XToTileX(bounds.x + bounds.width - 1);
              if (rightIndex < ImageManip.getMinTileIndexX())
                   rightIndex = ImageManip.getMinTileIndexX();
              if (rightIndex > ImageManip.getMaxTileIndexX())
                   rightIndex = ImageManip.getMaxTileIndexX();
              int topIndex = displayImage.YToTileY(bounds.y);
              if (topIndex < ImageManip.getMinTileIndexY())
                   topIndex = ImageManip.getMinTileIndexY();
              if (topIndex > ImageManip.getMaxTileIndexY())
                   topIndex = ImageManip.getMaxTileIndexY();
              int bottomIndex = displayImage.YToTileY(bounds.y + bounds.height - 1);
              if (bottomIndex < ImageManip.getMinTileIndexY())
                   bottomIndex = ImageManip.getMinTileIndexY();
              if (bottomIndex > ImageManip.getMaxTileIndexY())
                   bottomIndex = ImageManip.getMaxTileIndexY();
              for (tj = topIndex; tj <= bottomIndex; tj++) {
                   for (ti = leftIndex; ti <= rightIndex; ti++) {
                        Raster tile = displayImage.getTile(ti, tj);
                        DataBuffer dataBuffer = tile.getDataBuffer();
                        WritableRaster wr = Raster.createWritableRaster(sampleModel,
                                  dataBuffer, new Point(0, 0));
                        BufferedImage bi = new BufferedImage(colorModel, wr,
                                  colorModel.isAlphaPremultiplied(), null);
                        if (bi == null) continue;
                        int xInTile = displayImage.tileXToX(ti);
                        int yInTile = displayImage.tileYToY(tj);
                        atx = AffineTransform.getTranslateInstance(
                                  xInTile + panX, yInTile + panY);
                        g.drawRenderedImage(bi, atx);
              imageDrawn = true;
              if (cropOn) {
                   Rectangle cropRect = getDimensions();
                   if (cropRect == null) return;
                   g.setColor(Color.BLACK);
                   g.drawRect(cropRect.x, cropRect.y, cropRect.width, cropRect.height);
                   g.setComposite(makeComposite(0.5f));
                   g.fillRect(0, 0, cropRect.x, cropRect.y);
                   g.fillRect(cropRect.x, 0, viewerWidth - cropRect.x, cropRect.y);
                   g.fillRect(0, cropRect.y, cropRect.x, viewerHeight - cropRect.y);
                   g.fillRect(cropRect.x + cropRect.width, cropRect.y,
                             viewerWidth - cropRect.x, viewerHeight - cropRect.y);
                   g.fillRect(cropRect.x, cropRect.y + cropRect.height, cropRect.width,
                             viewerHeight - cropRect.y);
              g.dispose();
              if (((double)GarbageCollection.getFreeMem() /
                        (double)GarbageCollection.getRuntimeMem()) > 0.7d) {
                   System.out.println("Memory Usage: " +
                             (int)(((double)GarbageCollection.getFreeMem() /
                             (double)GarbageCollection.getRuntimeMem()) * 100) + "%");
                   System.out.println("Requesting garbage collection.");
                   GarbageCollection.runGc();
              setDoubleBuffered(true);
    Thank you in advance for support

    I moved the sizing out of the paint method and put in a component listener. I am still getting approx. the
    same performance. Possibly because I am trying to do too much. I have a mouse listener that allows
    the user to pan the image. I also have crop, rotate, shear, and flip methods. The main problem I think
    is when I change graphics to scale at (72d / 300d) which puts the display comparable to 300 dpi.
    My main reason for this was to allow zooming for the user. Am I overtasking the graphics object by
    doing this?

  • Issue with SESCrawlerExport component Snapshot issue

    Hi,
    I am facing issue after installing SESCrawlerExport.
    In "SES Crawler Export" page when I click "Take Snapshot" I am getting error saying "Aborted : Content Export already in progress".
    But this is the first time I am running after installation.
    I checked with it gives the following stack:
    Event generated by user 'sysadmin' at host 'localhost'. intradoc.common.ServiceException: badness - todo [ Details ]
    An error has occurred. The stack trace below shows more information:.
    !csUserEventMessage,sysadmin,localhost!$!syExceptionType2,intradoc.common.ServiceException,badness - todo
    intradoc.common.ServiceException: badness - todo
         at sescrawlerexport.SESCrawlerExportErrorFeed.write(SESCrawlerExportErrorFeed.java:104)
         at sescrawlerexport.SESCrawlerExportErrorFeed.clearCorruptFlag(SESCrawlerExportErrorFeed.java:355)
         at sescrawlerexport.SESCrawlerExportErrorFeed.clear(SESCrawlerExportErrorFeed.java:173)
         at sescrawlerexport.SESCrawlerExportThread.init(SESCrawlerExportThread.java:69)
         at sescrawlerexport.SESCrawlerExportServiceHandler.exportContent(SESCrawlerExportServiceHandler.java:60)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at intradoc.common.IdcMethodHolder.invokeMethod(ClassHelperUtils.java:461)
         at intradoc.common.ClassHelperUtils.executeMethodReportStatus(ClassHelperUtils.java:142)
         at intradoc.server.ServiceHandler.executeAction(ServiceHandler.java:75)
         at intradoc.server.Service.doCodeEx(Service.java:488)
         at intradoc.server.Service.doCode(Service.java:470)
         at intradoc.server.ServiceRequestImplementor.doAction(ServiceRequestImplementor.java:1350)
         at intradoc.server.Service.doAction(Service.java:450)
         at intradoc.server.ServiceRequestImplementor.doActions(ServiceRequestImplementor.java:1191)
         at intradoc.server.Service.doActions(Service.java:445)
         at intradoc.server.ServiceRequestImplementor.executeActions(ServiceRequestImplementor.java:1111)
         at intradoc.server.Service.executeActions(Service.java:431)
         at intradoc.server.ServiceRequestImplementor.doRequest(ServiceRequestImplementor.java:632)
         at intradoc.server.Service.doRequest(Service.java:1709)
         at intradoc.server.ServiceManager.processCommand(ServiceManager.java:357)
         at intradoc.server.IdcServerThread.run(IdcServerThread.java:195)
    Did any one face the same issue ever?

    I see another issue now...
    When I try to disable and the enable the crawler component through Component Wizard..
    Its showing me an error to correct before enabling....
    Its says:
    *" The following errors must be corrected before the component 'SESCrawlerExport' can be enabled:*
    The table 'SESCrawlerExport_Tracing' that is specified in the MergeRules table is not defined. Please eithe remove it from the MergerRules table or add to the ResourceDefinition table."+
    But i see SESCrawlerExport_Tracing defined in both MergeRules and ResourceDefinition in the conponent HDA file.
    So I suspect the aboting issue could be because of this issue
    Did any one get this kind of exception ???
    Can this is because of my SESCrawlerExport zip file(downloaded) that used for installation???
    Edited by: user13150267 on May 29, 2010 5:59 AM

Maybe you are looking for

  • What are the best settings in Compressor?

    I generally have two main needs: 1) 16:9 films (c. 25 mins or shorter) with sound to be screened in museums/galleries. Not HD. 2) The same but online, just to give a flavour of my work (but pointless if it loses too much quality). What are my best Co

  • IOS 7.04 Itunes error (1)

    I could do with a little help.  My iphone4 (not jailbroken) has been having an issue since i installed IOS 7.03.  The install crashed half way through and ever since, my phone just hasn't been right at all. It was working perfectly up to this point. 

  • Is there a Printer Selection Plugin?

    The problem: Printing to different printers in a studio from different apps; (b/w printers, colours printers, plates, with different presets, ie staple, booklet, double sided, features). It becomes a chore to go to print > printer > choose printer an

  • I purchased a itouch 2g and i went to restore it and it wont boot plz help

    i bought a itouch 2g model#A1288 and when i did a system restore on it because it had a bunch of junk on it it wont completely boot the apple logo turns to a skull and freezes please help i payed $200 for it off of some random guy so i cant get a ref

  • Logic for this math problem

    Before I get stinker replies for cross posting , let me tell that , i have been recommended to post this in this forum. My problem is such: I need to find a logic to implement the following : In the floating point number , say , 1.0.. the Integral pa