Scaling an object that contains a gradient

I'm working in Illustrator CS3. Got a question: I'm looking to scale an object that contains a gradient, but I want the position of the gradient to remain in the same position on the page. That is, I don't want the gradient to scale along with the object. Is it possible to do this without manually rebuilding the gradient?

Normal scaling of an object (using the Scale tool, Transform or dragging the bounding box) will always scale the gradient too, but there is a sort of workaround if you know where the gradient starts and ends in the original.
If you haven't already marked the beginning and end of your gradient, do so by pasting a copy of it in front (Cmd-F) and expanding the gradient - then you can see its start and end points when you turn off the preview. Mark what you need with guides and delete the expanded gradient. It's useful to make a guide that follows the angle of the gradient.
Now draw a gradient-filled rectangle behind your object and get the gradient to match the angle and position of the gradient in your object by dragging with the gradient tool according to the guides.
Having done this, copy and scale your object and change it into a clipping mask that masks the rectangle you just drew. Alternatively you can make a masking layer of your object if you know how to do that.
Lock the rectangle (if you are using a normal clipping mask) and then you can move the object (which is now a mask) at will and the gradient will stay put.
This is all a bit long-winded but please get back to me if you're lost :-)

Similar Messages

  • I know the name of an object - how do I get the name of the object that contains it?

    If I have a Movieclip, I can trace the name of the Movieclip
    that contains it using the _parent property.
    With a generic object, is there a way to trace the name of
    the object that contains it?
    Please, please tell me - this will be a huge help.
    Thanks

    Thanks for these comments - my problem isn't with MovieClips.
    I need to know if there is something which is the generic Objects
    equivalent to the MovieClips _parent property.
    Here's some code that hopefully will help explain further:
    class MyClass extends Object {
    var myObject:Object;
    function MyClass (){
    myFirstObject = new Object();
    myFirstObject.theParent = this;
    private function getNameOfParent(p_object:Object){
    // Some code to return the name of the object that contains
    p_object
    trace(p_object.__proto__); // Output: [object Object]
    trace(p_object._parent); // Output: undefined
    trace(p_object.theParent); // Output: [object Object]
    return ???
    public function doSomething(p_num:Number){
    var parentName = getNameOfParent(myObject);
    // do some more action...
    Timeline code:
    var myClass1 = new MyClass();
    myClass1.doSomething();

  • Parsing a String object that contains the database details in jsp

    Hi All,
    In my project i have a model which is a bean that contains
    a method :-
    UserBean.java
    ....getUserData()
    //the database connection is written here.
    st.executeUpdate("insert ----------");
    In the servlet i am calling the bean,
    ControllerServlet.java
    UserBean ub=new UserBean();
    Object obj=ub.getUserData();
    session.putValue("something",obj); //Here the obj contains all the database datas that is used in insert query
    //By using RequestDispacher i am forwarding this request & the response
    to the jsp page
    ViewJsp.jsp
    String data=(String)session.getValue("something");
    //Here "data" now contains all the database contents that is stored using insert query in the bean
    From here i need to parse the "data" in order to display the contents
    stored in the string "data" in to a html table.
    Plz. do provide a solution for this.It is very Urgent at the moment.
    So that i will be very thankful to u.
    Thanx,
    contactananth

    ok, first of all, in getData, i assume you do a SELECT, not an INSERT,
    so your bean code should look like:
    ResultSet rs = st.executeQuery(...) // or somethig like that
    return rs; // it will contain the data you needand in the jsp you write:
    ResultSet rs = (ResultSet)session.getValue("something");
    instead of
    String data=(String)session.getValue("something");
    i assume you know how to work with a ResultSet

  • Creating objects that contain objects

    What's the best practice for creating an object from a table that contains a list of objects from another table? For example, say I have an employees table:
    EMPLOYEES
    id    name
    1     Derek Epperson
    2     Judy Johnsonand I also have an equipment table that contains all the equipment belonging to each employee
    EQUIPMENT
    id    emp_id   name
    101   1        Laptop Computer
    102   1        Flash Drive
    103   2        Desktop Computer
    104   2        Wireless RouterI want to create a Java function that will return create a List of two Employees, each with a List<Equipment> of that employee's equipment. One option is to create the Employees and then query for Equipment separately, like this:
    List<Employee> employees = myDAO.getEmployees();
    for (Employee employee : employees) {
      employee.setEquipment(myDAO.getEquipment(employee.getId()));
    }However, that is a lot of database calls. Is there an easy way to do this in a single query?

    By JOIN, you mean connect them so that a query will return something like this?
    EMPLOYEES
    id    name             equip_id   equip_name
    1     Derek Epperson   101        Laptop Computer
    1     Derek Epperson   102        Flash Drive
    2     Judy Johnson     103        Desktop Computer
    2     Judy Johnson     104        Wireless RouterThen I would have to check on each row whether the id had changed, a la:
    rs = ps.executeQuery(getEmployeesAndEquipmentJoin);
    int previousId = -1;
    Employee employee
    while (rs.next()) {
      if (rs.getInt("id") != previousId) {
        previousId = rs.getInt("id");
        employee = new Employee(rs);
        employees.add(employee);
      employee.getEquipment.add(new Equipment(rs));
    }That seems a little awkward, but if that's the best way to do it without ORM then I can work with that.

  • Trying to Clone an array object that contains other objects

    I have an employee object with the fields name (String), Salary (Double), and hireDay (Date). Since the date field contains many int fields (year, month etc..), using a straight clone will not work.
    What I want to do is copy an array of employees into a new array.
    For example:
    Employee [] newEmps = (Employee[])OldEmps.clone()
    In the employee class, I implement the Cloneable interface and my code so far will copy one Employee. How do I change this to copy an array of empoyees? Specifically, since hireDay contains many fields, a straight super.clone of the array won't work. Here is my clone code:
         public Object clone()
         try {
              // call Object.clone()
         Employee cloned = (Employee)super.clone();
              // clone mutable fields
    cloned.hireDay = (Date)hireDay.clone();
         return cloned;
         catch (CloneNotSupportedException e)
         { return null; }
    Any help is appreciated. Thanks!
    -Eric

    There's so much I don't understand about that, it just
    isn't worth asking. Let me spell out my previous post
    since it seems to have gone right over your
    head.Employee[] emps;
    // here you fill in the array of Employees
    Employee[] clonedEmps = new Employee[emps.length];
    for (int z=0; z<emps.length; z++) {I understand this next line of code. My question lies within the clone() function
    clonedEmps[z] = emps[z].clone();OK - Let me try to clear things up. If we take from your example the original array "emps". Now for me, emps, is already filled up in main().
    So in main() when I call emps.clone(), my clone function starts running:
    // the employee class (which I created) implements the Cloneable
    // interface
    // This clone function is inside my employee class
    public Object [] clone()
    try {
    Employee [] cloned = (Employee)super.clone();
    // IS THIS NEXT LINE OF CODE REQUIRED TO MAKE A DEEP COPY? IF SO, How would I implement perhaps a for loop that would copy the hireDay from each element in the original array to the elements in the the new array?
    // Obviously, each employee (element in the array) has a hireDay
    // Please modify this next line of code to show me how.
    cloned.hireDay = (Date)hireDay.clone();
    return cloned;
    catch (CloneNotSupportedException e)
    { return null; }
    If I wanted to access say the "hireDay" field of the 3rd element in the original employee array INSIDE THE CLONE FUNCTION - then how would i access it?
    Thanks
    -Eric

  • Returning an object that contains a collection WL 9.2

    Hello,
    I have a class like this:
    public class data {
    private Collection<MyObject> coll; //MyObject is another class
    If I return this object from a web service call, i.e.
    @WebService
    public class HelloWorld {
         @WebMethod
    public data hello() {
    I get an error saying java class MyObject is not known, which makes sense, because I only declared "HelloWorld" to jwsc task.
    How can I make this class known, by annotation etc.?
    Someone suggested to use "IncludeSchema" in the jwsc task, but apparently that has been deprecated.
    Thanks!
    Edited by ghosh007 at 02/21/2008 12:59 PM
    Edited by ghosh007 at 02/21/2008 1:23 PM

    Hi,
    As you have this "Artiicle" class, extend it to be serializable and then define an Array of type Artiicle. So the return type would be an Array of a complex type i.e. Articles. In WSDL there will be type that defines an Array and this type can be used as a return message for your methode.
    Try this, I think it will help you.
    Regards,

  • Is there a way using lab view objects to let an object that is contained within another object get access to its owner?

    I've been playing with lvoop for 4 or 5 months now, and in general I like it very much, but I've repeatedly wanted to build classes that know something about who owns them and I can't figure out how to make this happen.
    The simple example I've been thinking about is imagine having a person class which contains a car class. Now say that I get an instance of a car class and I want to ask it who its owner is. In C++, I'd do this by giving the car class a pointer to the person class it belongs to. (Of course you have to worry about car objects that don't belong to anyone in which case the pointer has to point to NULL.)
    I've tried copying this idea by giving the car class a data value reference to a person class, but when I dereference the reference using an in place loop and call a method on it I get data from the moment the reference was made and not the current data of the person class.
    I realize this is sorta breaking data flow so maybe it's not possible on purpose?

    Scot18 wrote:
    I've tried copying this idea by giving the car class a data value reference to a person class, but when I dereference the reference using an in place loop and call a method on it I get data from the moment the reference was made and not the current data of the person class.
    Yes, LVOOP uses value based references, and when you split the wire to write the owner you created a data copy. The function you're after requires you do use a DVR for all class functions in which case you'll get reference based OOP, which is more familiar coming from text based OOP.
    It just so happens that G# uses that approach, take a look at it.
    /Y
    LabVIEW 8.2 - 2014
    "Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
    G# - Free award winning reference based OOP for LV

  • Is there any object in labview that contains a list of data for the user to select (selection one at a time) or add a new data?

    Is there any object in labview that contains a list of data for the user to select (selection one at a time) or add a new data?

    List and table controls -> listbox..is that what you are thinking of?
    The listbox presents the user with a list of options, and you can set it to only accept one selection at a time...Adding new data to the list can not be done directly by the user but if you make e.g. a text control and a button you can programatically insert new objects described in the text box when the button is pressed...(see example).
    If you need more than one column you have the multicolumn listbox. If you want the users to write new entries directly yu can use a table and read selected cells using it's selection start property to read what cell has been selected.
    MTO
    Attachments:
    Listbox_example.vi ‏34 KB

  • Reflecting updates to a ListCell that contains a mutable object

    Hi,
    I've seen many variants of this question, but unfortunately have not found the desired answer, so I thought to ask here. Apologies if missing something obvious!
    Objective:
    I start individual Tasks in batches. A ListCell reflects each Task, from initial request to eventual result. More batches can be submitted while one set is processing. When all processes of any batch is finished, they will eventually disappear from the ListView.
    As a result, I want a ListCell to reflect a Task, and reflect the transition from initial conception to eventual outcome.
    Predicament:
    I currently try this with an ObservableList of my own POJOs, each reflected using a custom ListCell extension.
    I have achieved this result, but it does not feel correct. First of all, I read that it is best practice not to change an ObservableList's objects under its feet. However, I have multiple threads working against the same list. With objects being added, removed and updated, it seemed safer to update the referenced object rather than try to manage synchronization to prevent concurrent modification issues. After all, I'm not really adding a new item, I'm wanting to update the representation of an item that is now in a finished state.
    Attempt details:
    I have achieved this by constructing an 'observableArrayList' with a Callback extractor. This Callback call method provides an Observable array containing an ObjectProperty, the property being a member variable of my POJO used in each ListCell. Each Task updates this object property with some result information at the end of its processing. This I believe ensure that change listeners are notified of updates to this POJO, via its ObjectProperty. (https://javafx-jira.kenai.com/browse/RT-15029)
    The ListCell constructed with this POJO is listening for updates, but I believe this is really to reflect additions and removals on the ObservableList that the ListView represents. However, in the case of updates, the private implementation of the ListCell updateItem method (javafx.scene.control.ListCell#updateItem) does not call the overridable updateItem method. This is because the object that caused the update is seen as equal to the object the ListCell currently holds (they're the same instance, so this is true). However, if the overridable updateItem method is never invoked, I can't get the custom ListCell to update its representation of the ListCell object that has changed since its last representation was rendered.
    If I make my custom POJO always return false in its overriden equals method, the overridable updateItem method is invoked and I get the opportunity to detect the change in the object and render a new representation. This works, but this feels wrong and like a hack.
    Can anyone help point me at the correct way of doing this please? Happy to provide more information if needed.
    Thanks,
    Louis

    If the changes in the ObservableList are to be reflected in the UI, you need to make these changes on the JavaFX Application Thread. Ensuring this happens (using Platform.runLater(...) if necessary) will also prevent any concurrent modification issues.
    I would approach this by binding the text property or graphic property (or both) of the custom ListCell to the appropriate properties of your POJO. Here's a simple example where I have a list view displaying a bunch of "counters" which count in a background thread. The cell display is updated when the state of the task changes. I introduced a counter property (which is a bit redundant; I could have used the progress property or message property) to demonstrate updating a property on the FX Application thread using Platform.runLater(...).
    Because ListCells can be reused, you need to account for the fact that the item (task) displayed may change during the lifecycle of the cell. You can do this using a listener to the itemProperty (which is what I did), or by overriding the updateItem(...) method.

  • I have  a singleton that contains my data object. How to refresh components

    I have a singleton that contains my data object. This
    singleton data is used to populate comboboxes and datagrids across
    various custom components that are children of the main
    application. These components can manipulate the singleton. When
    these changes are made to the singleton what do I have to do to get
    this data to refresh across the componets that use its data?

    I assume that your mail app on your iPad/iPhone is Apple Mail.  You can open a MS Word/Excel document in Adobe Reader for iOS and convert it to PDF at a time.
    In Mail, long press (press & hold) an attachment icon.
    Select "Open in Adobe Reader".
    Follow the instructions shown in Adobe Reader to subscribe to a paid service called "Adobe PDF Pack" to convert the document to PDF.
    Please note that Adobe Reader for iOS itself is a free app but the subscription for the Word/Excel to PDF conversion is a paid service (i.e. not free).
    In case you have any questions about Adobe PDF Pack, here's the user forum.
    Adobe PDF Pack

  • How to get a list of schemas that contain objects

    Hello,
    Kindly check on how to get a list of schema that contain objects.
    Regards,
    Tarman.

    Here is the oracle version info and it run under HP-UX.
    Oracle9i Enterprise Edition Release 9.2.0.5.0 - 64bit Production
    With the Partitioning and Real Application Clusters options
    JServer Release 9.2.0.5.0 - Production
    I have problem when run the query,
    SQL> select owner, count(object_name) from dba_objects where owner is not in ('S
    YS','SYSTEM','SYSMAN');
    select owner, count(object_name) from dba_objects where owner is not in ('SYS','
    SYSTEM','SYSMAN')
    ERROR at line 1:
    ORA-00908: missing NULL keyword
    Thanks.

  • This page contains some SWF objects that may not work properly...

    Hello Guys
    I bought this menu made by f-source into my page:
    http://beta.asphalt-driveway-sealing.com/, it's working fine except I got this message each time I am opening my file with dreamweaver CS4: 'this page contains some SWF objects that may not work properly in the most recent versions of Internet Explorer. Dreamweaver cannot  convert them to the new SWF markups. Please delete each of them and insert again' and what I did but still got this message
    the developer told me that: "I previous versions of Dreamweaver you could disable the Active
    Content Converter http://f-source.com/before_insert/
    In CS4 there is no such option."
    Please let me know what can I do then.
    Many Thanks, T&T

    Hi
    CS4 uses a 'nested' type of object code to insert swf/flv files, which is more compliant than previous code. Obviously the f-source extension is not cs4 compliant if it is changing this, (the message indicates it is doing so) and is something you should pursue via there support department. However even though it is giving you this message it should still work on live pages.
    PZ
    www.pziecina.com

  • What's the maximum number of view criteria that a view object can contain?

    We are making extensive use of view criteria in our view objects, mainly for LOV purposes. Is there a figure on the maximum amount of view criteria a view object can contain.
    Regards
    Ollyando
    Somewhere in Canada

    Hi,
    I am not aware of a limitation
    Frank

  • Zooming a Jpanel that contains Jbutton

    My question is how to zoom a jpanel that contains several jbutton... I am not sure what method to use.... when using a Graphics2D object there seem to be only methods as g.drawString(...)
    g.drawRectangle(..) etc... I am kind of familiar with
    AffineTransform, scaling matrix, etc but not how to zoom a jpanel with jcomponent...
    I hope some one out there understand what i am trying to do...please could you give me any idea
    thanx

    Hello.
    The solution could be the following:
    1. Create interface ZoomPane with the following methods:
    boolean isZoomMode
    float getZoomFactor
    2. ZoomPane interface must be implemented by some JComponent (JPanel will fit, assume it's called JZoomPanel)
    3. the paint method's body of the JZoomPanel should looks like:
    Graphics2D g2 = (Graphics2D)g;
    if(isZoomMode()){
    float zoomFactor = getZoomFactor();
    g2.scale(zoomFactor, zoomFactor);
    super.paint(g);
    4. Use updated RepaintManager.
    This solution solve all painting problem. The mouse event transformation problem can be solved as described above (by means of the glass pane).

  • How to customize a List object to contain line items other than String

    I'd like to create a List that contains line items with the following form:
    check box followed by a string followed by a button.
    I'd like the list to be backed by an object array that has a similar form:
    boolean, String, boolean
    which define if the item is checked, it's title, and whether or not to display the button.
    So I'd like to have code something like this:
    // ten items in this lists
    MyList myList = new MyList(10);
    // first item
    MyObject myObject = new MyObject(false, "Item 1", true);
    myList.add(myObject);
    // add the rest of the items...I can't use Swing, I only have AWT available in a J2ME environment.
    Where do I start?
    Can I do this with List?
    I've looked at GridBagLayout but I'm unfamiliar with it. Would a GridBagLayout work?
    Do I need to create a custom control from scratch (based on Panel or ScrollPane, for example) to accomplish this?
    Thanks,
    Nick.

    List only takes Strings. Here's an possibility with GridBagLayout:
    import java.awt.*;
    import java.awt.event.*;
    public class ListTest implements ActionListener
        Object[][] data =
            { Boolean.TRUE,  "John Ericsen",   Boolean.TRUE  },
            { Boolean.FALSE, "Heidi Pall",     Boolean.TRUE  },
            { Boolean.FALSE, "Gregg Fletcher", Boolean.FALSE },
            { Boolean.TRUE,  "Pieter Gaynor",  Boolean.TRUE  },
            { Boolean.TRUE,  "Janice Clarke",  Boolean.TRUE  },
            { Boolean.TRUE,  "May McClatchie", Boolean.FALSE },
            { Boolean.TRUE,  "Bill Horton",    Boolean.TRUE  },
            { Boolean.FALSE, "Helmet Krupp",   Boolean.TRUE  },
            { Boolean.FALSE, "Ian George",     Boolean.TRUE  },
            { Boolean.TRUE,  "Jill Smythe",    Boolean.FALSE }
        public void actionPerformed(ActionEvent e)
            Button button = (Button)e.getSource();
            String ac = button.getActionCommand();
            System.out.println("ac = " + ac);
        private Panel getPanel()
            Panel panel = new Panel(new GridBagLayout());
            GridBagConstraints gbc = new GridBagConstraints();
            gbc.insets = new Insets(2,2,2,2);
            //gbc.weightx = 1.0;         // horizontal dispersion
            //gbc.weighty = 1.0;         // vertical dispersion
            for(int j = 0; j < data.length; j++)
                Checkbox cb = new Checkbox("", ((Boolean)data[j][0]).booleanValue());
                gbc.gridwidth = 1;
                panel.add(cb, gbc);
                gbc.gridwidth = GridBagConstraints.RELATIVE;
                gbc.anchor = GridBagConstraints.WEST;
                panel.add(new Label((String)data[j][1]), gbc);
                gbc.anchor = GridBagConstraints.CENTER;
                gbc.gridwidth = GridBagConstraints.REMAINDER;
                if(((Boolean)data[j][2]).booleanValue())
                    Button b = new Button("call");
                    b.setActionCommand((String)data[j][1]);
                    b.addActionListener(this);
                    panel.add(b, gbc);
                else
                    panel.add(new Label("  "), gbc);
            return panel;
        private Panel getList()
            Panel child = getPanel();
            ScrollPane scrollPane = new ScrollPane()
                public Dimension getPreferredSize()
                    return new Dimension(200, 125);
            scrollPane.add(child);
            Panel panel = new Panel(new GridBagLayout());
            panel.add(scrollPane, new GridBagConstraints());
            return panel;
        private static WindowListener closer = new WindowAdapter()
            public void windowClosing(WindowEvent e)
                System.exit(0);
        public static void main(String[] args)
            Frame f = new Frame();
            f.addWindowListener(closer);
            f.add(new ListTest().getList());
            f.setSize(400,400);
            f.setLocation(200,200);
            f.setVisible(true);
    }

Maybe you are looking for

  • Anchored text boxes in XML

    I am wondering if anyone can help.. I have created a structured indesign document (structured as in tagged for XML import). My problem is the first tagged object is an anchored text box which needs to sit on top of the second anchored tagged picture

  • HR: Mass Update Personnel subareas

    Hey All,         I wanted to know if there is a way to mass update the personnel subareas for all the personnel areas in HR. I know that we can maintain the personnel sub areas in SPRO but doing this manually is going to be very time consuming since

  • JSObject in Firefox?

    Hey Guys I've done some searching and haven't found an answer yet. The question is, have any of you found a solution for using JSObject to call javascript methods from the applet in Firefox? I've got code that works fine in IE. Many thanks. H Update:

  • Displaying Text inside Path

    Hi, I have drawn a path and i want a text to be added in the center of the path. Is there any way to add the text ? Kindly suggest me good soultion TIA

  • Oracle Database Express Edition 10g; Designer, PL/SQL; Download

    Hi, I am new to this forum, I hope that I am posting in the right one :) I am refreshing my SQL knowledge an installed the "Oracle Database Express Edition 10g Release 2 (10.2)" which works fine. I now would like to learn PL/SQL and Oracle Designer.