Changing the bounds....

i am have problems changing the size of my java applet, could anyone please help
cheers
sinky

If you mean applet size as displayed on a web page, simply change the HTML invoking the applet.
- Saish
"My karma ran over your dogma." - Anon

Similar Messages

  • Can we change the bound location of an operator using OMB?

    Hi,
    I'm trying to change the location of an table operator using the following code:
    OMBALTER MAPPING 'MAP_NAME' MODIFY OPERATOR 'TABLE_TEST' SET PROPERTIES (database_link) VALUES ('PROJECT1/SOURCE1/TEMP_TABLE3')
    OMBCOMMIT
    OMBPlus tells me that the command ran successfully. But if i take a look on the design center, the change didn't occur. The old location for the operator remains.
    Am i using the right property type? database_link?
    Thank You!
    Filipe

    What you've run only change the link location. It doesn't change the bound location.
    I've write an OMB scripts to automate the changing of bound location within different project .
    set OMBPROMPT ON
    OMBDCC
    OMBCC '/'
    set projects [OMBLIST PROJECTS]
    puts -nonewline "Please enter the Project Name ($projects): "
    gets stdin projectName
    set path [lindex [OMBDCC] 1]
    OMBCC '$projectName'
    set modules [OMBLIST ORACLE_MODULES]
    puts -nonewline "Please enter the Module Name ($modules): "
    gets stdin moduleName
    puts "================"
    puts "Finding on Module $moduleName"
    set path [lindex [OMBDCC] 1]
    set no_mod 1
    OMBCC '$path/$moduleName'
    set no_map 1
    puts "Find $moduleName"
    foreach mapname [OMBLIST MAPPINGS] {
    foreach klname [OMBRETRIEVE MAPPING '$mapname' GET OPERATORS] {
    set bname [lindex [OMBRETRIEVE MAPPING '$mapname' OPERATOR '$klname' GET BOUND_OBJECT] 1]
    set oname [lindex [OMBRETRIEVE MAPPING '$mapname' OPERATOR '$klname' GET BOUND_OBJECT] 0]
    # PTI_DW_TST is the name of project orig bound
    # PTI_DW is the name of project destination bound
    set result [regexp {^(/PTI_DW_TST)+} $bname match]
    if { $result == 1 } {
    set myresult [regsub {^(/PTI_DW_TST)+} $bname "/PTI_DW" new_bname]
    #puts "$klname ($oname) : $bname => $new_bname"
    OMBRECONCILE $oname '$new_bname' TO MAPPING '$mapname' OPERATOR '$klname' USE (RECONCILE_STRATEGY 'REPLACE', MATCHING_STRATEGY 'MATCH_BY_OBJECT_NAME')
    puts "Reconcile Mapping $mapname change $bname to $new_bname for operator $klname with type $oname"
    incr no_map
    OMBCC '/'

  • Changing the bounding box size

    When I go to print an image in Photoshop CC, a dialogue box appears and on the left-hand side is the image to be printed. Bordering the image are small diagonal lines which I'm assuming are the bounding box. The distance between the edge of the page varies from side to side and I want to center the photo. I can't see how to do that.
    Thanks.

    The print dialog preview area show basically three areas.  The Paper size the printer is set to and the sizes are displayed with numeric unites. If you see small diagonal lines these are showing the areas the printer can not print on with the current settings.  With different printer setting this area may change for example if the printer support borderless the side non printable may go way but there still be some top and bottom non printable area. The Bottom non printable area may go away if you switch from sheet feed to roll paper feed. Inside the diagonal line is the printable area and inside that a bounding box of the image. If You check scale for media the image will be scaled to fit within the print area.

  • Is it possible to change the bounds of a progressBar? (to a different shape

    I want to draw the shape of a battery, and use it as a progress bar. Now I know I can do this from scratch, and I have done a test case, but it simply doesn't look as good as the JProgressBar does.
    I have tried reading the JProgressBar class, to see where it draws the rect, and copy the class, only make it fill a <code>Shape</code> but I haven't had any luck.
    anyone have any ideas?

    I'm not sure I completely understand your response...what do you mean by aspect? also don't or cant?

  • Hyperlink panel disabled - So how do I change the appearance of a hyperlink?

    I am at the final stages of layout and the only thing preventing me from publishing electronically is that the hyperlinks have bounding boxes around them. I have previously been able to use the hyperlink options to change the appearance of a hyperlink but my panel is completely greyed out > see below. I can only change the destination and that does not give any link options. The panel doesn't even register any hyperlinks although you can see many in my screen grab alone. I have modified the character style but since these are active links (which should remain active), the style does not change the bounding box. I even tried retyping links and linking them to their URL with InDesign but I cannot control any options after a link has been made. I also cannot afford to do this +100 times. Anyone have any tips? I'm using CS6 on a MacBook Pro. I've already rebooted the computer and InDesign to no avail. Am I doing something wrong? Is there a script I can use?
    Thanks to anyone who can help!

    This is the sort of problem that is typically casued by damaged prefs. See Replace Your Preferences

  • Change AutoScroll Bounds in JTextPane

    I cannot figure this out for the life of me. I would like to CHANGE the bounds for the autoscroll on a JTextPane that resides inside a JScrollPane when the user selects text and moves the mouse outside of the "autoscroll bounds".
    The normal bounds for scrolling down a JTextPane (when inside a JScrollPane) are usually the bounds of the JTextPane itself. (You can verify this with my example by selecting some text with the mouse button held down, and moving your cursor outside the bottom of the window). I would like to move the bottom bounds up higher into the window (indicated by the black line that resides on the glasspane).
    I have provided this example to use as a starting point. It doesn't do anything of use right now. I have tried about 20 things, but things have gotten so messed up, and the level of internal code that I started to mess around with got way over my head... so I'm just going to post this with a clean start, and hopefully we can move in a positive direction. I will relay my findings about a paticular route if we start moving down one i've already failed at.
    Thanks for you time.
    -Js
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Graphics;
    import javax.swing.JFrame;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTextPane;
    import javax.swing.text.BadLocationException;
    import javax.swing.text.StyledDocument;
    public class AutoScrollTest extends JFrame
         //DATA
         private static final int Y_SCROLL_THRESHOLD = 150;
         //GUI
         private JPanel glassPanel;
         private JScrollPane scrollPane;
              private JTextPane textPane;
         public AutoScrollTest()
              this.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
              this.setGlassPane(getGlassPanel());
              this.setContentPane(getScrollPane());
              getGlassPanel().setVisible(true);
              this.pack();
              this.setVisible(true);
         private JPanel getGlassPanel()
              if(glassPanel == null)
                   glassPanel = new JPanel()
                        public void paintComponent(Graphics g)
                             super.paintComponent(g);
                             g.setColor(Color.BLACK);
                             g.drawLine(0, Y_SCROLL_THRESHOLD, 300, Y_SCROLL_THRESHOLD);
                   glassPanel.setOpaque(false);
              return glassPanel;
         private JScrollPane getScrollPane()
              if(scrollPane == null)
                   scrollPane = new JScrollPane(getTextPane());
                   scrollPane.setPreferredSize(new Dimension(300,300));
              return scrollPane;
         private JTextPane getTextPane()
              if(textPane == null)
                   textPane = new JTextPane();
                   try
                        StyledDocument sd = textPane.getStyledDocument();
                        for(int i=1; i<1000; i++)
                             sd.insertString(sd.getLength(),"This is line: " + i + "\n", null);
                   catch(BadLocationException ble)
                        ble.printStackTrace();
              return textPane;
         public static void main(String args[])
              new AutoScrollTest();
    }

    camickr & StanislavL:
    Great work guys. I have used both of your ideas... and it works GREAT! I'll split the dukes between you.
    Please take a look at the finished code, its very cool. Again, thanks.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    public class AutoScrollTest extends JFrame
         //DATA
         private static final int Y_SCROLL_THRESHOLD = 150;
         private Timer scrollTimer;
         //GUI
         private JPanel glassPanel;
         private JScrollPane scrollPane;
              private JTextPane textPane;
         public AutoScrollTest()
              this.setDefaultCloseOperation(javax.swing.JFrame.EXIT_ON_CLOSE);
              this.setGlassPane(getGlassPanel());
              this.setContentPane(getScrollPane());
              getGlassPanel().setVisible(true);
              this.pack();
              this.setVisible(true);
         private JPanel getGlassPanel()
              if(glassPanel == null)
                   glassPanel = new JPanel()
                        public void paintComponent(Graphics g)
                             super.paintComponent(g);
                             g.setColor(Color.BLACK);
                             g.drawLine(0, Y_SCROLL_THRESHOLD, 300, Y_SCROLL_THRESHOLD);
                   glassPanel.setOpaque(false);
              return glassPanel;
         private JScrollPane getScrollPane()
              if(scrollPane == null)
                   scrollPane = new JScrollPane(getTextPane());
                   scrollPane.setPreferredSize(new Dimension(300,300));
              return scrollPane;
         private JTextPane getTextPane()
              if(textPane == null)
                   textPane = new JTextPane();
                   MouseInputAdapter mia = new MouseInputAdapter()
                        public void mouseDragged(MouseEvent e)
                             Point viewPortPoint = getScrollPane().getViewport().getViewPosition();
                             if(e.getY()-viewPortPoint.getY() > Y_SCROLL_THRESHOLD)
                                  getScrollTimer().start();
                             else
                                  getScrollTimer().stop();
                        public void mouseReleased(MouseEvent e)
                             getScrollTimer().stop();
                   textPane.addMouseListener(mia);
                   textPane.addMouseMotionListener(mia);
                   try
                        StyledDocument sd = textPane.getStyledDocument();
                        for(int i=1; i<1000; i++)
                             sd.insertString(sd.getLength(),"This is line: " + i + "\n", null);
                   catch(BadLocationException ble)
                        ble.printStackTrace();
              return textPane;
         private Timer getScrollTimer()
              if(scrollTimer == null)
                   scrollTimer = new Timer(60,new MyScrollListener(getTextPane(),getScrollPane().getVerticalScrollBar()));
              return scrollTimer;
         public static void main(String args[])
              new AutoScrollTest();
    class MyScrollListener implements ActionListener
         private JTextPane textPane;
         private JScrollBar scrollBar;
         public MyScrollListener(JTextPane textPane, JScrollBar scrollBar)
              this.scrollBar = scrollBar;
              this.textPane = textPane;
         public void actionPerformed(ActionEvent e)
              //Move down the scrollbar
              scrollBar.setValue(scrollBar.getValue()+scrollBar.getBlockIncrement());
              //Update the mouse highlight
              PointerInfo mousePointerInfo = MouseInfo.getPointerInfo();
              Point convertedPoint = SwingUtilities.convertPoint(null,mousePointerInfo.getLocation(),textPane);
              Position.Bias[] bias = new Position.Bias[1];
              int mouseOffset = textPane.getUI().viewToModel(textPane,convertedPoint, bias);
              if (bias[0] == Position.Bias.Backward && mouseOffset != 0)
                   --mouseOffset;
              textPane.setSelectionEnd(mouseOffset);
    }

  • Can you change the colour of an 'image' bounding box?

    This concerns bounding boxes not 'strokes'.
    Is it possible to customise the default colour of a bounding box around an image?
    I know that the default 'rectangle image frame' matches the Layer colour (eg: Layer 1 - Light Blue, with an the image bounded by a brown box) which is easily changed by moving it to another layer (eg: Layer 2 - Red, which displays an image bounding box of Cyan). What defines the colour of the bounding box of an image that is placed inside the 'rectangle image frame' and can it be changed?
    I have no real necessity to change it, I just wondered if it was possible?
    Steve

    I'm not sure you understand the terminology.
    The bounding box is an imaginary rectangle that encloses the shape of an object or group of objects. For a simple graphics frame this is the same size and shape as the frame and is poisitioned on the frame edge (and it's what you see when you select the frame). The bounding box is used for calculating object positioning. When dispalyed, it takes on the color assigned to the layer.
    The frame edge is also fictitious. It's a screen display aid that can be tuned on or off to help you locate objects and also uses the color assigned to the layer. It corresponds to the path that describes the edge of the frame, so might not be rectangular (a bounding box is always rectangular).
    The stroke is an attribute assigned to the path describing the perimeter of a closed object or the path itself of an open path. Stokes can be assigned a weight, color, and stroke style such as dotted or striped.
    An image placed inside a frame has it's own bounding box, but not a frame edge or stroke. To see the image bounding box use the direct select tool to select the image inside the frame. If you crop an image so it is larger than the containing frame, or or enlarge the frame so the image does not completely fill it, you can see the differnce between the bounding boxes very easily. The color of the image bounding box is also tied to the layer color and is not editable by the user.

  • Preserving a field's value on changing the field access parameter?

    I have a form that has a number of fields that are set to "protected" and have calculation scripts on them. If the user selects a specific radio button option elsewhere, the form sets the .access parameter to "open" and disables the calculation so that the user can enter whatever they want into those fields. The problem arises when the user imports XML data via Acrobat. The radio button choice is made (since it is bound to an element in the schema), but when the form changes the access parameter of the fields to "open", it fires the calculate event on the fields and we lose the value assigned to those fields from the imported XML.
    Is there any way to preserve the fields value when it changes from "protected" to "open"? Here is an example PDF w/ XSD.
    The more I dig into this the more I think this might be an issue with calculate.override not disabling the calculations on a field, even when it is set to "open" - at least until the user manually edits that field.

    Ok, worked out a solution. It's specific to my application, but maybe someone else will get something out of it. What I did is moved the calculation script from the field I am changing the access parameter of (call it "Field A") to the fields that feed into that field (call them "Field B" and "Field C"). Now, when the user triggers the exit events on B and C, each one fires a script that updates the value of A. For my application, this works only because B and C are hidden from the use if they toggle the radio button allowing them to manually enter A.
    Basically, instead of A pulling values from B and C to calculate it's value, B and C check each other and push values to A.

  • How to proceed with a requirement on changing the input type

    I have a requirement that seems rather simple yet I am having a hard time achieving it. What I have is a table where there is a Data_Value field and a Data_Type field. The Data_Value is stored in the database as a VARCHAR2(100) and the Data_Type contains the following values: STRING, DATE, DATETIME, NUMBER.
    The page I am working on is an update page, and what I am hoping to achieve through PPR is that whenever the user changes the Data_Type (I have these in a messageChoice) that the Data_Value will then be rendered with the correct settings.
    Originally I thought that I could just programmetically change the DataType property in the messageTextInput I am using, but this was causing errors since I had it bound to that field in the view which is a Varchar. I then thought that I could create one field of each type and render the one I want based on the selection, but I am getting an error saying: Data Type - Attribute set for DataType in view object Xo2cCustAcctUpdateVO1 failed whenever a new value is picked from my picklist.
    Does anyone have some suggestions on how I should tackle this issue? As a last resort I thought about just leaving that field as a String (which is how it is stored anyway) and do some validation in my controller to ensure it is formatted correctly.
    Thanks,
    Greg

    Greg,
    The simplest approach would be to define one field per data type and toggle them based on the data type selected from the choice bean. Use SPEL and PPR.

  • Getting the bounds of a drawn image on a panel

    Hello, I have a problem with getting the bounds of a drawn image on a panel...Since it is drawn as graphics, i tried getClipBounds and since my class extends JPanel i tried to get the bounds from the panel but neither of them worked properly. It only gets the bounds of a jframe that contains the panel.Then i tried to put the panel in a layeredpane and then a container; but this time the image disappeared completely. Hope someone can help or tell me what I am doing wrong. Thanks in advance. Here is the code below:
    By the way what I am trying to do in this code is basically zooming the image in and out by dragging or the mouse wheel. But I need to get the bounds so that I can use this.
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    * @author Admin
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Image;
    import java.awt.Point;
    import java.awt.RenderingHints;
    import java.awt.Toolkit;
    import java.awt.event.MouseEvent;
    import java.awt.event.MouseListener;
    import java.awt.event.MouseMotionListener;
    import java.awt.event.MouseWheelEvent;
    import java.awt.event.MouseWheelListener;
    import java.awt.geom.AffineTransform;
    import java.awt.geom.NoninvertibleTransformException;
    import java.awt.geom.Point2D;
    import javax.swing.JFrame;
    import javax.swing.JLayeredPane;
    import javax.swing.JPanel;
    public class ZoomDemo extends JPanel {
    AffineTransform tx = new AffineTransform();
    String imagePath = "D:/Documents and Settings/Admin/Belgelerim/tsrm/resim.jpg";
    Image image = Toolkit.getDefaultToolkit().getImage(imagePath);
    int width = image.getWidth(this);
    int height = image.getHeight(this);
    int scrwidth = Toolkit.getDefaultToolkit().getScreenSize().width;
    int scrheight = Toolkit.getDefaultToolkit().getScreenSize().height;
    double zoomfac = 1.0;
    int xAdj;
    int yAdj;
    int prevY;
    double scale = 1.0;
    Point pt;
    public static int x;
    public static int y;
    public static int w;
    public static int h;
    public ZoomDemo() {
    this.addMouseWheelListener(new ZoomHandler());
    this.addMouseListener(new ZoomHandler());
    this.addMouseMotionListener(new ZoomHandler());
      repaint();
    @Override
    public void paintComponent(Graphics g) {
    super.paintComponent(g);
    Graphics2D g2 = (Graphics2D) g;
    g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    g2.drawImage(image, tx, this);
    // x =    (int) g2.getClipBounds().getX();
    // y=     (int) g2.getClipBounds().getY();
    // w=     (int) g2.getClipBounds().getWidth();
    // h=     (int) g2.getClipBounds().getHeight();
    // System.out.println(x+" "+y+" "+w+" "+h);
    //  public int getRectx(){
    //    return x;
    //public int getRecty(){
    //    return y;
    //public int getRectw(){
    //    return w;
    //public int getRecth(){
    //    return h;
    private class ZoomHandler implements MouseWheelListener,MouseListener, MouseMotionListener {
    public void mousePressed(MouseEvent e){
        System.out.println("Mouse Pressed");
    xAdj = e.getX();
    yAdj = e.getY();
    prevY = getY();
    public void mouseDragged(MouseEvent e){
           System.out.println("Mouse Dragged");
    boolean zoomed = false;
    if(e.getY()<prevY){
         zoomfac = zoomfac + 0.1;
         prevY = e.getY();
         zoomed = true;
    else if(e.getY()>prevY){
         zoomfac = zoomfac - 0.1;
         prevY = e.getY();
         zoomed = true;
       scale = zoomfac;
    Point2D p1 = new Point((int)xAdj-(width/2),(int)yAdj-(height/2));
    Point2D p2 = null;
    try {
    p2 = tx.inverseTransform(p1, null);
    } catch (NoninvertibleTransformException ex) {
    // should not get here
    ex.printStackTrace();
    return;
    tx.setToIdentity();
    tx.translate(p1.getX(), p1.getY());
    tx.scale(scale, scale);
    tx.translate(-p2.getX(), -p2.getY());
    tx.transform(p1, p2);
    ZoomDemo.this.revalidate();
    ZoomDemo.this.repaint();
    public void mouseWheelMoved(MouseWheelEvent e) {
    if (e.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL) {
    Point2D p1 = e.getPoint();
    Point2D p2 = null;
    try {
    p2 = tx.inverseTransform(p1, null);
    } catch (NoninvertibleTransformException ex) {
    // should not get here
    ex.printStackTrace();
    return;
    scale -= (0.1 * e.getWheelRotation());
    scale = Math.max(0.1, scale);
    tx.setToIdentity();
    tx.translate(p1.getX(), p1.getY());
    tx.scale(scale, scale);
    tx.translate(-p2.getX(), -p2.getY());
    ZoomDemo.this.revalidate();
    ZoomDemo.this.repaint();
            public void mouseClicked(MouseEvent e) {
                //throw new UnsupportedOperationException("Not supported yet.");
            public void mouseReleased(MouseEvent e) {
                //throw new UnsupportedOperationException("Not supported yet.");
            public void mouseEntered(MouseEvent e) {
               // throw new UnsupportedOperationException("Not supported yet.");
            public void mouseExited(MouseEvent e) {
               // throw new UnsupportedOperationException("Not supported yet.");
            public void mouseMoved(MouseEvent e) {
               // throw new UnsupportedOperationException("Not supported yet.");
    public static void main(String[] args) {
    //SwingUtilities.invokeLater(new ZoomDemo());
    int scrwidth = Toolkit.getDefaultToolkit().getScreenSize().width;
    int scrheight = Toolkit.getDefaultToolkit().getScreenSize().height;
    JFrame f = new JFrame("Zoom");
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.setSize(scrwidth , scrheight);
    //JLayeredPane lp = new JLayeredPane();
    //f.add(lp);
    ZoomDemo zd = new ZoomDemo();
    zd.getBounds();
    f.add(zd);
    //int x = (int) zd.getX();
    //int y = (int) zd.getY();
    //int w = (int) zd.getWidth();
    //int h = (int) zd.getHeight();
    //System.out.println(x+" "+y+" "+w+" "+h);
    //zd.setBounds(x ,y ,w ,h );
    //lp.add(zd, JLayeredPane.DEFAULT_LAYER);
    //f.setLocationRelativeTo(null);
    f.setVisible(true);
    //lp.setVisible(true);
    //zd.setVisible(true);
    }Edited by: .mnemonic. on May 26, 2009 11:07 PM
    Edited by: .mnemonic. on May 27, 2009 11:00 AM

    You'll need a stable point in the component to track and orient to the scaling transform(s).
    From this you can construct whatever you need in the way of image location and size.
    Let's try a center&#8211;of&#8211;image tracking point:
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.awt.image.BufferedImage;
    import javax.swing.*;
    import javax.swing.event.MouseInputAdapter;
    public class ZD extends JPanel {
        BufferedImage image;
        Point center;
        AffineTransform at = new AffineTransform();
        Point2D.Double origin = new Point2D.Double(0,0);
        public ZD(BufferedImage image) {
            this.image = image;
            center = new Point(image.getWidth()/2, image.getHeight()/2);
        protected void paintComponent(Graphics g) {
            super.paintComponent(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_INTERPOLATION,
                                RenderingHints.VALUE_INTERPOLATION_BICUBIC);
            g2.drawRenderedImage(image, at);
            g2.setPaint(Color.red);
            g2.fill(new Ellipse2D.Double(origin.x-1.5, origin.y-1.5, 4, 4));
            g2.setPaint(Color.blue);
            g2.fill(new Ellipse2D.Double(center.x-1.5, center.y-1.5, 4, 4));
        private void setTransform(double scale) {
            // keep image centered over Point "center"
            double x = center.x - scale*image.getWidth()/2;
            double y = center.y - scale*image.getHeight()/2;
            origin.setLocation(x, y);
            at.setToTranslation(x, y);
            at.scale(scale, scale);
        public static void main(String[] args) throws java.io.IOException {
            java.net.URL url = ZD.class.getResource("images/hawk.jpg");
            BufferedImage image = javax.imageio.ImageIO.read(url);
            ZD test = new ZD(image);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.add(test);
            f.setSize(500,500);
            f.setLocation(100,100);
            f.setVisible(true);
            test.addMouseListener(test.mia);
            test.addMouseMotionListener(test.mia);
        /** MouseAdapter okay in j2se 1.6+ */
        private MouseInputAdapter mia = new MouseInputAdapter() {
            final double SCALE_INC = 0.05;
            final int SCALE_STEP = 20;
            double scale = 1.0;
            double lastStep;
            public void mousePressed(MouseEvent e) {
                Point p = e.getPoint();
                center.setLocation(p);
                //System.out.printf("center = [%3d, %3d]%n", p.x, p.y);
                setTransform(scale);
                repaint();
            public void mouseDragged(MouseEvent e) {
                // scale up/down with relative vertical motion
                int step = (e.getY() - center.y)/SCALE_STEP;
                if(step != lastStep) {
                    scale += SCALE_INC*((step < lastStep) ? -1 : 1);
                    //System.out.printf("step = %3d  scale = %.3f%n", step, scale);
                    setTransform(scale);
                    lastStep = step;
                    repaint();
    }

  • How can i  change the column label text in a alv table display

    how can i change the column label text in a alv table display??
    A similar kinda of question was posted previuosly where the requirement was the label text was needed and following below code was given as solution :
    <i>*  declare column, settings, header object
    DATA: lr_column TYPE REF TO cl_salv_wd_column.
    DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
    DATA: lr_column_header type ref to CL_SALV_WD_COLUMN_HEADER.
    get column by specifying column name.
    lr_column = lr_column_settings->get_column( 'COLUMN_NAME1' ).
    set Header Text as null
    lr_column_header = lr_column->get_header( ).
    lr_column_header->set_text( ' ' ).</i>
    My specific requirement is i have an input field on the screen and i want reflect that value as the column label for one of the column in the alv table. I have used he above code with slight modification in the MODIFYVIEW method of the view since it is a process after input. The component gets activated without any errors but while run time i get an error stating
    <i>"The following error text was processed in the system CDV : Access via 'NULL' object reference not possible."</i>
    i have checked in debugging and the error occured at the statement :
    <i>lr_column = lr_column_settings->get_column( 'CURRENT_YEAR' ).</i>Please can you provide me an alternative for my requirement or correct me if i have done it wrong.
    Thanks,
    Suri

    I found it myself how to do it. The error says that it is not able to find the reference object i.e  it is asking us to refer to the table. The following piece of code will solve this problem. Have to implement this in WDDOMODIFYVIEW method of the view. This thing works comrades enjoy...
      DATA : lr_cmp_usage TYPE REF TO if_wd_component_usage,
             lr_if_controller  TYPE REF TO iwci_salv_wd_table,
             lr_cmdl   TYPE REF TO cl_salv_wd_config_table,
             lr_col    TYPE REF TO cl_salv_wd_column.
      DATA : node_year  TYPE REF TO if_wd_context_node,
             elem_year  TYPE REF TO if_wd_context_element,
             stru_year  TYPE if_alv_layout=>element_importing,
             item_year  LIKE stru_year-i_current_year,
             lf_string    TYPE char(x),
      DATA: lr_column TYPE REF TO cl_salv_wd_column.
      DATA: lr_column_header TYPE REF TO cl_salv_wd_column_header.
      DATA: lr_column_settings TYPE REF TO if_salv_wd_column_settings.
    Get the entered value from the input field of the screen
    node_year  = wd_context->get_child_node( name = 'IMPORTING_NODE' ).
    elem_year  = node_year->get_element( ).
      elem_year->get_attribute(
       EXPORTING
        name = 'IMPORT_NODE-PARAMETER'
       IMPORTING
        value = L_IMPORT_PARAM ).
      WRITE L_IMPORT_PARAM TO lf_string.
    Get the reference of the table
      lr_cmp_usage  =  wd_this->wd_cpuse_alv( ).
      IF lr_cmp_usage->has_active_component( ) IS INITIAL.
        lr_cmp_usage->create_component( ).
      ENDIF.
      lr_if_controller  = wd_this->wd_cpifc_alv( ).
      lr_column_settings = lr_if_controller->get_model( ).
    get column by specifying column name.
      IF lr_column_settings IS BOUND.
        lr_column = lr_column_settings->get_column( 'COLUMN_NAME').
    set Header Text as null
        lr_column_header = lr_column->get_header( ).
        lr_column_header->set_text( lf_string ).
    endif.

  • How to get the bound object of an external table with OMB

    Hello,
    I try to find it but without success. So may be one of you, know this secret information.
    I want to synchronize with the help of an OMB script my external tables.
    OMBSYNCHRONIZE FLAT_FILE '/MY_PROJECT/MY_FLAT_FILE_MODULE/MY_FLAT_FILE' RECORD 'MY_RECORD' TO EXTERNAL_TABLE 'MY_EXTERNAL_TABLE' \
    USE (RECONCILE_STRATEGY 'REPLACE', MATCHING_STRATEGY 'MATCH_BY_OBJECT_ID')For this purpose, I need to know the bound object. When you synchronize with the help of the GUI, you see it easily.
    Example:
    /MY_PROJECT/MY_FLAT_FILE_MODULE/MY_FLAT_FILE/MY_RECORDI searched in the properties of the external table and I don't see a BOUND OBJECT property.
    OMBDESCRIBE CLASS_DEFINITION 'EXTERNAL_TABLE' GET PROPERTY_DEFINITIONS
    BAD_FILE_LOCATION BAD_FILE_NAME BUSINESS_NAME DATA_FILES DEPLOYABLE DESCRIPTION
    DISCARD_FILE_LOCATION DISCARD_FILE_NAME ENDIAN GENERATE_ERROR_TABLE_ONLY GENERAT
    ION_COMMENTS LOAD_NULLS_WHEN_MISSING_VALUES LOG_FILE_LOCATION LOG_FILE_NAME NLS_
    CHARACTERSET NUMBER_OF_REJECTS_ALLOWED PARALLEL_ACCESS_DRIVERS PARALLEL_ACCESS_M
    ODE REJECTS_ARE_UNLIMITED SHADOW_TABLESPACE SHADOW_TABLE_NAME STRING_SIZES_IN TR
    IM UOIDThen I try the BOUND_OBJECT cached properties of a mapping operator but no luck.
    OMBRETRIEVE EXTERNAL_TABLE 'MY_EXTERNAL_TABLE' GET BOUND_OBJECT
    OMB00001: Encountered BOUND_OBJECT at line: 1, column: 56. Was expecting one of:
    "PROPERTIES" ...
        "REF" ...
        "REFERENCE" ...
        "COLUMN" ...
        "DEFAULT_LOCATION" ...
        "FLAT_FILE" ...
        "RECORD" ...
        "COLUMNS" ...
        "DATA_FILES" ...
        "DATA_RULE_USAGES" ...I have already the file and the record with the FLAT_FILE and RECORD properties
    OMBRETRIEVE EXTERNAL_TABLE  'MY_EXTERNAL_TABLE'  GET FLAT_FILE
    OMBRETRIEVE EXTERNAL_TABLE  'MY_EXTERNAL_TABLE'  GET RECORDBut how can I get the flat file module:
    MY_FLAT_FILE_MODULEDoes anybody know how OWB retrieve this information ?
    Thanks in advance and good day
    Nico
    Edited by: gerardnico on Jan 13, 2010 12:08 PM
    Change get the location by get the flat_file_module

    Yes, Oleg. It's what's worried me.
    The BOUND_OBJECT property of a table operator is not in the API.
    OMBDESCRIBE CLASS_DEFINITION 'TABLE_OPERATOR' GET PROPERTY_DEFINITIONS
    ADVANCED_MATCH_BY_CONSTRAINT AUTOMATIC_HINTS_ENABLED BOUND_NAME BUSINESS_NAME CO
    NFLICT_RESOLUTION DATABASE_FILE_NAME DATABASE_LINK DATA_COLLECTION_FREQUENCY DAT
    A_RULES DB_LOCATION DEBUG_BOUND_NAME DEBUG_DB_LOCATION DESCRIPTION DIRECT ENABLE
    _CONSTRAINTS ERROR_SELECT_FILTER ERROR_SELECT_ROLL_UP ERROR_TABLE_NAME EVALUATE_
    CHECK_CONSTRAINTS EXCEPTIONS_TABLE_NAME EXTRACTION_HINT IS_TEMP_STAGE_TABLE JOIN
    RANK KEYS_READONLY LOADING_HINT LOADING_TYPE MATCH_BY_CONSTRAINT OPTIMIZE_MERGE
    PARTITION_NAME PEL_ENABLED PRIMARY_SOURCE RECORDS_TO_SKIP REPLACE_DATA ROW_COUNT
    ROW_COUNT_ENABLED SCHEMA SINGLEROW SORTED_INDEXES_CLAUSE SUBPARTITION_NAME TARG
    ET_FILTER_FOR_DELETE TARGET_FILTER_FOR_UPDATE TARGET_LOAD_ORDER TEMP_STAGE_TABLE
    _EXTRA_DDL_CLAUSES TEST_DATA_COLUMN_LIST TEST_DATA_WHERE_CLAUSE TRAILING_NULLCOL
    S TRUNCATE_ERROR_TABLE UOID USE_LCR_APIThen I was wondering if anyone knew a little bit the same hidden property but to get the flat file source object of an external table.
    Cheers
    Nico

  • How do I move an object from one photo to another and then change the scene, i.e.  winter to sum?

    How do I move an object from one photo to another and then change the scene, i.e.  winter to summer?

    OK.
    Open the picture with the new scene. This will be your canvas.
    Open the picture with object A, select it with one of the selection tools, go to Edit>copy
    Go back to the new scene/canvas, Go to Edit>paste
    Repeat for object B
    Use the move tool to position A & B, each on its own layer. Use the corner handles of the bounding box to resize, if necessary
    You should have 3 layers: Background layer, and the 2 layers with A & B
    Note: It's best if the resolution of the 3 picture files is the same value.

  • How to change the data provider of the tree with the selection of combobox

    This is my XML data in a file named `nodesAndStuff.xml`.
        <?xml version="1.0" encoding="utf-8"?>
        <root>
            <node label="One" />
            <node label="Two" />
            <node label="Three" />
            <node label="Four" />
            <node label="Five" />
            <node label="Six" />
            <node label="Seven" />
            <node label="Eight" />
            <node label="Nine" />
        </root>
    The component using this data source is an `XMLListCollection` which is bound to a spark `ComboBox` and the code for that is:
        <s:Application name="Spark_List_dataProvider_XML_test"
            xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:mx="library://ns.adobe.com/flex/halo"
            initialize="init();">
        <fx:Script>
            <![CDATA[
                private function init():void {
                    xmlListColl.source = nodes.children();
    private function closeHandler(event:Event):void {
                    myLabel.text = "You selected: " +  ComboBox(event.target).selectedItem.label;                 myData.text = "Data: " +  ComboBox(event.target).selectedItem.data;
            ]]>
        </fx:Script>
        <fx:Declarations>
            <fx:XML id="nodes" source="nodesAndStuff.xml" />
        </fx:Declarations>
        <mx:ComboBox id="cmbList" dataProvider="{ListXLC}" labelField="STOREVALUE"  close="closeHandler(event);"/>
         <s:dataProvider>
            <s:XMLListCollection id="xmlListColl" />
         </s:dataProvider>
    </mx:ComboBox>
    <mx:VBox width="250" color="0x000000">
                <mx:Text  width="200" color="blue" text="Select a type of credit card."/>
                <mx:Label id="myLabel" text="You selected:"/>
                <mx:Label id="myData" text="Data:"/>
            </mx:VBox> 
    <mx:Tree id="myTree" width="50%" height="100%" visible="false" />
    </s:Application>
    now another of my xml for example this is one.xml
    <?xml version="1.0" encoding="utf-8"?>
    <root>
        <node label="Eleven" />
        <node label="Twelve" />
        <node label="Thirteen" />
        <node label="Fourteen" />
        <node label="Fifteen" />
        <node label="Sixteen" />
        <node label="Seventeen" />
        <node label="Eightteen" />
        <node label="Nineteen" />
    </root>
    and another one is two.xml
    <?xml version="1.0" encoding="utf-8"?>
    <root>
        <node label="twety one" />
        <node label="twety two" />
        <node label="twety three" />
        <node label="twety four" />
        <node label="twety five" />
        <node label="twety six" />
        <node label="twety seven" />
        <node label="twety eight" />
        <node label="twety nine" />
    </root>
    Now I have added my tree just below the list and I have saved counting from 10 to 19 in `one.xml`, 20 to 29 in `two.xml` and so on in different XML file. I have no clue how to connect the XML containing counting from 10 to 19 as the single node in tree at the selection of label one in list and make its visiblity true.this all are dependent on combobox as on selection of item in combobox will lead to change the dataprovider of tree at runtime. i.e on selecting value one in combobox one.xml should be the data provider for tree control. Can anyone help me on this

    This is my XML data in a file named `nodesAndStuff.xml`.
        <?xml version="1.0" encoding="utf-8"?>
        <root>
            <node label="One" />
            <node label="Two" />
            <node label="Three" />
            <node label="Four" />
            <node label="Five" />
            <node label="Six" />
            <node label="Seven" />
            <node label="Eight" />
            <node label="Nine" />
        </root>
    The component using this data source is an `XMLListCollection` which is bound to a spark `ComboBox` and the code for that is:
        <s:Application name="Spark_List_dataProvider_XML_test"
            xmlns:fx="http://ns.adobe.com/mxml/2009"
            xmlns:s="library://ns.adobe.com/flex/spark"
            xmlns:mx="library://ns.adobe.com/flex/halo"
            initialize="init();">
        <fx:Script>
            <![CDATA[
                private function init():void {
                    xmlListColl.source = nodes.children();
    private function closeHandler(event:Event):void {
                    myLabel.text = "You selected: " +  ComboBox(event.target).selectedItem.label;                 myData.text = "Data: " +  ComboBox(event.target).selectedItem.data;
            ]]>
        </fx:Script>
        <fx:Declarations>
            <fx:XML id="nodes" source="nodesAndStuff.xml" />
        </fx:Declarations>
        <mx:ComboBox id="cmbList" dataProvider="{ListXLC}" labelField="STOREVALUE"  close="closeHandler(event);"/>
         <s:dataProvider>
            <s:XMLListCollection id="xmlListColl" />
         </s:dataProvider>
    </mx:ComboBox>
    <mx:VBox width="250" color="0x000000">
                <mx:Text  width="200" color="blue" text="Select a type of credit card."/>
                <mx:Label id="myLabel" text="You selected:"/>
                <mx:Label id="myData" text="Data:"/>
            </mx:VBox> 
    <mx:Tree id="myTree" width="50%" height="100%" visible="false" />
    </s:Application>
    now another of my xml for example this is one.xml
    <?xml version="1.0" encoding="utf-8"?>
    <root>
        <node label="Eleven" />
        <node label="Twelve" />
        <node label="Thirteen" />
        <node label="Fourteen" />
        <node label="Fifteen" />
        <node label="Sixteen" />
        <node label="Seventeen" />
        <node label="Eightteen" />
        <node label="Nineteen" />
    </root>
    and another one is two.xml
    <?xml version="1.0" encoding="utf-8"?>
    <root>
        <node label="twety one" />
        <node label="twety two" />
        <node label="twety three" />
        <node label="twety four" />
        <node label="twety five" />
        <node label="twety six" />
        <node label="twety seven" />
        <node label="twety eight" />
        <node label="twety nine" />
    </root>
    Now I have added my tree just below the list and I have saved counting from 10 to 19 in `one.xml`, 20 to 29 in `two.xml` and so on in different XML file. I have no clue how to connect the XML containing counting from 10 to 19 as the single node in tree at the selection of label one in list and make its visiblity true.this all are dependent on combobox as on selection of item in combobox will lead to change the dataprovider of tree at runtime. i.e on selecting value one in combobox one.xml should be the data provider for tree control. Can anyone help me on this

  • Changing the size of a JComboBox

    Greetings,
    I am trying to build a mechanism to perform zooming on a JPanel with an arbitrary collection of components (including nested JPanels). I've tried a number of things with little success. The following is my most promising contraption. It can zoom labels, textfields, checkboxes, and buttons. However, for some reason, the combo box refuses to accept a changes to its size. I'm not sure why this is the case. Its font changes size appropriately.
    Anyway, I'm running in JDK 1.4, and the following program lays out a palette of components. To change the size of the components, hit F1 to zoom in, and F2 to zoom out.
    import java.awt.Component;
    import java.awt.Container;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.KeyEventPostProcessor;
    import java.awt.KeyboardFocusManager;
    import java.awt.event.KeyEvent;
    import java.awt.geom.AffineTransform;
    import javax.swing.JButton;
    import javax.swing.JCheckBox;
    import javax.swing.JComboBox;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JPanel;
    import javax.swing.JTextField;
    public class Demo extends JPanel
        public class Zoomer
            private double m_zoom = 1;
            private JPanel m_panel;
            public Zoomer(JPanel panel)
                m_panel = panel;
            private AffineTransform getTransform()
                return AffineTransform.getScaleInstance(m_zoom, m_zoom);
            private Font transform(Font font)
                return font.deriveFont(getTransform());
            private Dimension transform(Dimension dimension)
                Dimension retval = new Dimension();
                retval.setSize(dimension.getWidth() * m_zoom, dimension.getHeight() * m_zoom);
                return retval;
            private void performZoom(Container container)
                Component[] components = container.getComponents();
                for(int i = 0; i < components.length; i++)
                    Component component = (Component)components;
    component.setFont(transform(component.getFont()));
    component.setSize(transform(component.getSize()));
    for(int i = 0; i < components.length; i++)
    Component component = components[i];
    if(component instanceof Container)
    performZoom((Container)component);
    public double getZoom()
    return m_zoom;
    public void setZoom(double zoom)
    if(zoom > 8.0 || zoom < 0.125) return;
    m_zoom = zoom;
    performZoom(m_panel);
    public void zoom(double factor)
    setZoom(getZoom() * factor);
    public Demo()
    JPanel panel = new JPanel();
    panel.add(buildPanel());
    panel.add(buildPanel());
    final Zoomer zoomer = new Zoomer(panel);
    add(panel);
    KeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventPostProcessor(new KeyEventPostProcessor()
    public boolean postProcessKeyEvent(KeyEvent e)
    if(e.getID() != KeyEvent.KEY_PRESSED) return false;
    if(e.getKeyCode() == KeyEvent.VK_F1)
    zoomer.zoom(1.2);
    if(e.getKeyCode() == KeyEvent.VK_F2)
    zoomer.zoom(1/1.2);
    return false;
    private JPanel buildPanel()
    JPanel panel = new JPanel();
    panel.add(new JLabel("label: "));
    panel.add(new JTextField("Hello World"));
    panel.add(new JCheckBox("checkbox"));
    panel.add(new JComboBox(new String[] { "Bread", "Milk", "Butter" }));
    panel.add(new JButton("Hit Me!"));
    return panel;
    * Create the GUI and show it. For thread safety, this method should be
    * invoked from the event-dispatching thread.
    private static void createAndShowGUI()
    // Create and set up the window.
    JFrame frame = new JFrame("Demo");
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    // Create and set up the content pane.
    Demo newContentPane = new Demo();
    newContentPane.setOpaque(true); // content panes must be opaque
    frame.setContentPane(newContentPane);
    // Display the window.
    frame.pack();
    frame.setVisible(true);
    public static void main(String[] args)
    // Schedule a job for the event-dispatching thread:
    // creating and showing this application's GUI.
    javax.swing.SwingUtilities.invokeLater(new Runnable()
    public void run()
    createAndShowGUI();

    component.setSize(transform(component.getSize()));First of all the above line is not needed. The LayoutManager will determine the bounds (size and location) of each component in the container based on the rules of the LayoutManager. The Flow Layout is the default layout manager for a panel and it simply uses the preferred size of the component as the size of the component.
    So what happens is that when you change the font of the component you are changing the preferred size of the component.
    So why doesn't the combo box work? Well I took a look at the preferred size calculation of the combo box (from the BasicComboBoxUI) and it actually caches the preferred size. The combo box uses a renderer, so the value is cached for performance one would assume. The method does recalculate the size when certain properties change. Note the isDisplaySizeDirty flag used in the code below:
             else if (propertyName.equals("prototypeDisplayValue")) {
                    isMinimumSizeDirty = true;
                    isDisplaySizeDirty = true;
                    comboBox.revalidate();
             else if (propertyName.equals("renderer")) {
                    isMinimumSizeDirty = true;
                    isDisplaySizeDirty = true;
                    comboBox.revalidate();
                }It also handles a Font property change as well:
                else if ( propertyName.equals( "font" ) ) {
                    listBox.setFont( comboBox.getFont() );
                    if ( editor != null ) {
                        editor.setFont( comboBox.getFont() );
                    isMinimumSizeDirty = true;
                    comboBox.validate();
                }but notice that the isDisplaySizeDirty flag is missing. This would seem to be a bug (but I don't know why two flags are required).
    Anyway, the following change to your code seems to work:
    // component.setSize(transform(component.getSize()));
    if (component instanceof JComponent)
         ((JComponent)component).updateUI();
    }

Maybe you are looking for