Request For Enhancement: paintForeground() and paintBackground()

I would like to propose that the paintComponent() methods of JComponent (and descendents) and the paint methods of ComponentUI (and descendents) be further broken down to call paintBackground() followed by paintForeground(), and possibly even paintBorder() and paintFocus().
This way, the look of JComponents could be more easily customized, especially the backgrounds. As it is now, if one wishes a JComponent merely to have a textured background, for instance, the implementer is also saddled with the much more difficult tasks of dealing with Fonts, Font Metrics, Icons, Gaps, Alignments, Margins, Borders, Preferred Sizes, etc.

Hi, Marsian -
This is why I find this useful:
This way, the look of JComponents could be more easily customized,
especially the backgrounds. As it is now, if one wishes a JComponent
merely to have a textured background, for instance, the implementer
is also saddled with the much more difficult tasks of dealing with
Fonts, Font Metrics, Icons, Gaps, Alignments, Margins, Borders,
Preferred Sizes, etc.I wasn't proposing that paintForeground(), paintBackground(), etc., be
de-coupled, i.e. separate events in the event dispatch thread
...sorry... I should have been more clear.
What I had in mind was, the current paintComponent() method would be
re-implemented to merely call, in order, paintBackground(),
paintForeground(), paintFocus(), and paintBorder(). That way, one
could provide an alternate implementation of any one (or more) of
these methods without an impact on the others. As it is, if I want to
change how the background gets painted, e.g. with a texture, I am stuck
with dealing with the foreground as well, as I mentioned before.
Thanks,
---Mark

Similar Messages

  • Request For Enhancement: Add method mouseIn() to JComponent

    I would like to propose that a new method be added to JComponent. This method would return boolean true if the mouse is currently over the JComponent and false if not. Method signature: public boolean mouseIn().
    This method would make it easier to accomplish visual feedback for when the mouse is over any JComponent, similar to how rollover can be done for AbstractButton.
    Currently, the best method I can come up with is to add a MouseListener that records the state from the mouseEntered() and mouseExited() events. I add my own method mouseIn() that returns that state. Then method paintComponent() can check this state by calling mouseIn() and paint the component accordingly.
    At first I thought the MouseListener should be added in each and every constructor of each and every JComponent, but then realized actually, the place to provide this feedback is in the ComponentUI class for each JComponent, as part of a custom Look & Feel. What I have come up with is to add the MouseListener to the JComponent in the ComponentUI's createUI() method, recording the state in the ComponentUI instance. The problem with this is, it makes it impossible for the ComponentUI to be a singleton like most of the ComponentUI classes are for the standard L&F's. This requires that each JComponent instance have its own ComponentUI instance.
    If JComponent had this proposed mouseIn() method, the ComponentUI methods could simply call this method, and the ComponentUI would not have to record JComponent-instance-specific state. There would not be a need for so many instances of ComponentUI and MouseListener.

    Hi,
    imho this request for enhancement is much better than your other onces. In fact monitoring this state is more than just using mouseEntered(..) and mouseExited(...) - if there is a method, it must return a valid state - if mouse has entered and you make the component invisible, mouse does not exit before that takes place - if you open another application which covers this component, mouse does also not exit before, but the component stays visible - you see, there are much more things to control, to get a valid state at any time. And mouseIn() is an ugly name and says less - why not isMouseOver() or something like this?
    Another thing is, why do you request this for JComponent?- Should java.awt.Component not get this feature in your opinion?
    greetings Marsian

  • I pull fiftyfour bytes of data from MicroProcessor's EEPROM using serial port. It works fine. I then send a request for 512 bytes and my "read" goes into loop condition, no bytes are delivered and system is lost

    I pull fiftyfour bytes of data from MicroProcessor's EEPROM using serial port. It works fine. I then send a request for 512 bytes and my "read" goes into loop condition, no bytes are delivered and system is lost

    Hello,
    You mention that you send a string to the microprocessor that tells it how many bytes to send. Instead of requesting 512 bytes, try reading 10 times and only requesting about 50 bytes at a time.
    If that doesn�t help, try directly communicating with your microprocessor through HyperTerminal. If you are not on a Windows system, please let me know. Also, if you are using an NI serial board instead of your computer�s serial port, let me know.
    In Windows XP, go to Start, Programs, Accessories, Communications, and select HyperTerminal.
    Enter a name for the connection and click OK.
    In the next pop-up dialog, choose the COM port you are using to communicate with your device and click OK.
    In the final pop
    -up dialog, set the communication settings for communicating with your device.
    Type the same commands you sent through LabVIEW and observe if you can receive the first 54 bytes you mention. Also observe if data is returned from your 512 byte request or if HyperTerminal just waits.
    If you do not receive the 512 byte request through HyperTerminal, your microprocessor is unable to communicate with your computer at a low level. LabVIEW uses the same Windows DLLs as HyperTerminal for serial communication. Double check the instrument user manual for any additional information that may be necessary to communicate.
    Please let me know the results from the above test in HyperTerminal. We can then proceed from there.
    Grant M.
    National Instruments

  • Request for proper information and to refuse to help when it's missing

    On behalf of many of us volunteers who are getting tired of guessing the environment of those who are asking for help, I hereby
    ASK ALL VOLUNTEERS TO STOP RESPONDING TO REQUESTS FOR TECHNICAL ASSISTANCE THAT DO NOT PROVIDE SUFFICIENT INFORMATION
    In general, sufficient information should include:
    1) Operating system and Service Pack, not just the family.
    - Vista is a Family of operating systems. Insufficient information (need Home, Home Premium, etc.)
    - XP is a Family of operating systems. Insufficient information (need Home, Professional, etc.)
    - Linux is a Family of operating systems. Insufficient information (need Oracle Enterprise Linux 4 Update 4, Red Hat EL 4 Update 2, OpenSuSE 10.3, Fedora 8, etc.)
    2) Version of database installed to 4 digits (9.2.0.6, 10.2.0.3, 11.1.0.6) and the database's ORACLE_HOME and ORACLE_SID
    3) Which product being used to access the database, which computer that product is on, and the Oracle Home from which the product is run. (SQLPlus, same home as the database)
    4) The output of lsnrctl status, the contents of the tnsnames.ora and the contents of the listener.ora
    5) The output of the ipconfig /all or ifconfig and of hostname
    6) Copy paste of the actual error message, not just a paraphrase of part of a line..
    Any other ideas?

    I am not requesting this to be enforced by the forum.
    I am requesting that people like you and me reply by linking to this thread (or to the other excellent related threads) INSTEAD of replying. If we do it consistently, eventually the newbies will also enforce it voluntarily, and that will cut the useless teeth-pulling-effort replies to a minimum.
    In your 90% posts figure - you do realize that that means 90% of the posts are badly formed and are wasting your time as well as mine.
    Or - if they were properly formed - you and I could answer that with a lot less effort and a lot faster. With the implication is that the person asking would generally get a resolution a lot faster as well. Net result - you and I get to sleep more (or answer more questions) and people with problems are happier because they get them resolved faster.

  • Transport request for BW queries and roles.

    Hi All,
    we need to craete 20 bw queries on 4 multiproviders. We need to save 18 queries as workbooks in one role and the other 2 queries in other role.  Both the roles and queries does not exist and will be created in Developement environment.
    We just want to know how we can transport them in the quality environment. What is the right method to transport them.
    Can we transport all the object queries, workbooks and roles in number of transport requests so that if few queries or workbooks needs any changes then we do not have to transport all objects just the request which includes the changed objects.
    Thanks & Kind Regards,
    Hardeep

    Thanks a lot for all of you for your quick response. But i still have questions.
    If we create one transport for roles and one transport for each query then we will be having 21 transport requests. But the transport request on same multiprovider can lock the clacuated key figures and restricted key figures, if they are present in more than one query, it means they will be present in more than one transport requests, so they can be locked and trasport request will be failed.
    If i just create one transport request for all the objects roles, quaries & workbooks it will not loack any object, and transport request will not fail. But i have to transport all the objects again if i need to change one of the queries.
    Please let me know if there is a method that i can divide my queries as per multiprovider and can create transport requests as per multiprovider so that we can not lock calculated keyfigures and restricted key figures. Is workbooks can be published in the role in the same transport request. If it is and if in more than one transport request we are publishing the different workbooks to the same role, will it lock the role.

  • I redeem my accound $15 via Gift Card,shows on my ID BUT when I purchase request for my pastword and shows its not there,what's going on?

    I just purchase a gift card for my iTunes account. Follow the instruction and place the code to redeem my account. On iTUnes Store Home it shows $15.00 has been credited to my account but when I got to purchase its not there and request for my credit card infomation. Yet when I check the account infomation its in my name but the $15.00 gift card isn't present in my account. What happen to my money?

    Forget it I fixed myself

  • How to file RFE (request for enhancement) for iPhone features?

    I have some ideas for configurability options, and want to see how I can file RFE's or see what's been filed, so I don't duplicate someone else's....

    http://www.apple.com/feedback/iphone.html
    The last think you should worry about is duplicating someone else's request. The more people request the same thing, the more priority it will likely get.

  • How to unlock the request for a report and add the same query to new reques

    hi,
         how to unlock the request for a  and add the same query to new reques

    You can unlock in SE03 tcode.
    Goto tcode SE01, give the transport number --> display --> double click on the transport --> in the next screen select all the elements --> delete --> save.
    To attach it to another transport, In RSA1, click on transport connection> Choose Object types> query elements --> here you can find your query/ or you can search, which you can drag to right and attach to the transport (using truck button).

  • Request for enhancement

    I've been using JDeveloper 9i for about 6 months now. In the beta releases there were some
    annoying bugs, but those seem to have been fixed in the final version. So now I'm mostly
    satisfied with the product. It's a great IDE with a lot of nice features. I've decided to
    use it instead of JBuilder mostly because of the price. The reason I'm posting this is that
    there are some minor things that I would like to be improved in the product. Some of them I
    consider bugs, other missing features. Hardly any of them are really serious, but they can
    get annoying when you're doing something every day. Some of these I've grown accustomed to
    in other IDEs. Maybe you've heard about some of these things before. Maybe you've already
    fixed some of them. Well here we go:
    1. It is not possible to replace text only within the selected area of a file. The replacement
    always affects the whole file.
    2. The only way to accept a suggestion from Code Insight is to press enter. It would be nice
    if you could also use the next logical operator like . (dot). Then the editor should insert the
    selected suggestion followed by . and start Code Insight again on the next level of the expression.
    3. Copying text does not always work. Sometimes I have to press Ctrl+C many times for the text
    to be copied. I have a feeling this happens when I do it too quickly. Could be a general Java bug.
    Also it seems to only happen on my home PC which is very slow (300 mHz). It's too slow for
    JDeveloper anyway, so I need a new one. JDeveloper, like all IDEs written in Java, is very
    resource intensive. I guess that's just a fact of life.
    4. I would like automatic indent after {
    5. I would like } to automatically align with the corresponding {
    6. When inserting Code Templates you have to know the exact code for a template. It would be nice
    to be able to type only part of the code and have the editor show me a list of templates whose code
    start with those characters.
    7. In the dialog box for overriding methods you have to use the mouse to check which methods to
    override. I would like to be able to use the space bar for that purpose.
    8. The dialog boxes for implementing interfaces and overriding methods do not work for inner
    classes.
    9. Code Insight does not always work. Sometimes the list of suggestions only includes classes
    and not variables and methods in the current class/method. This seem to happen only when the cursor
    is to the right of an operator, including comma. So for instance Code Insight works for the first
    argument in a method invocation, but not for subsequent arguments. And it works for the left hand
    side of an addition, multiplication etc., but not for the right hand side.
    10. When you add a new variable in the class editor, you cannot declare its type as an array.
    11. In the debugger it would be nice to have breakpoints that would fire when the value of a
    variable changed.
    12. In the debugger it would be nice to be able to evaluate and watch the result of method calls.
    13. It would be nice to have a tool to internationalise and localise an application's hard coded
    text strings.
    14. It would be nice to have numbered bookmarks in the editor. Press one key combination to set
    a bookmark and another one to jump back to that same bookmark.
    15. In the class editor there is another small problem. When you tell it to make a property bound,
    it adds the methods addPropertyChangeListener/removePropertyChangeListener/firePropertyChange and
    the variable propertyChangeSupport. This is good, but the problem is that JDeveloper doesn't look in
    the superclasses to see if they already contain these methods/variables.
    16. In the property editor you cannot set the displayed mnemonic of a JLabel to a character. You have
    to use the character code.
    17. When you edit a property in the property editor and then press enter the focus moves to the first
    property.
    18. In the property editor when you edit a property that has a drop down list of possible values, you
    cannot change the value using the keyboard (at least not by pressing enter). This may be a Java bug.
    19. In the property editor the property horizontalAlignment cannot be changed at all. For instance I
    get a message like "Field RIGHT not found in class javax.swing.JTextField".
    20. The Oracle JVM doesn't handle class and method names that use the special Norwegian characters
    with these unicode numbers: 198 216 197 230 248 229
    According to the Java standard it should, and the Sun JVM has always done so.
    21. Finally, one thing that would be really nice is for the UI editor to support visual form inheritance
    like Delphi does. I don't think any Java IDEs do, and it's the thing that I miss the most.

    16. In the property editor you cannot set the displayed mnemonic of a JLabel to a character. You have
    to use the character code. This has been fixed in the soon to be availabel release 9.0.3
    17. When you edit a property in the property editor and then press enter the focus moves to the first
    property.This has been fixed in the soon to be availabel release 9.0.3
    18. In the property editor when you edit a property that has a drop down list of possible values, you
    cannot change the value using the keyboard (at least not by pressing enter). This may be a Java bug.This is a known bug; 2157458
    19. In the property editor the property horizontalAlignment cannot be changed at all. For instance I
    get a message like "Field RIGHT not found in class javax.swing.JTextField". Works fine in the soon to be available release 9.0.3. The problem was that the SwingConstants import was not being
    added. There does remain, however, a similar bug (2337382) where constants inherited via an interface will still
    produce the same problem (e.g. setting orientation property of JScrollPane which implements SwingConstants). This
    is still sceduled to be addressed in 9.0.3.
    21. Finally, one thing that would be really nice is for the UI editor to support visual form inheritance
    like Delphi does. I don't think any Java IDEs do, and it's the thing that I miss the most. Some work has been done in this area for 9.0.3 which will improve the user experience (user will see an accurate
    portrayal of the superclass available for design, however access to inherited members is not yet ready). There still
    remains more work to do in this area that is currently scheduled for release 9.0.4..

  • Photoshop Elements Organizer request for enhancements

    I have two enhancements that would really make my day in Photoshop Elements Organizer:
    The first would be the ability to move and copy items from one catalog to another.  This might entail being able to have more than one catalog open at a time.  I could then drag and drop or copy an item from one to another.  I have several items in a family picture catalog that more appropriately belong in my genealogy catalog.  The only way to rectify this now is to delete from the one catalog and then recreate it in the other.
    The second would be the capability to stream albums directly to my Smart TV.  Windows Media Player can currently do this, but I would have to recreate my albums in Windows Media Player, which seems a waste of time if I have already built albums in the Elements catalog.  (There apparently is a way to do this currently using iTunes and an Apple TV device, but I would like to be able to do this directly from Elements).
    The above two enhancements would be really cool!!
    Thanks for your consideration.

    Sorry to be a wet blanket, but I really don't think Adobe will ever adopt your suggestion #1. I just don't see any interest on Adobe's part for either PSE or Lightroom to allow multiple catalogs to be in use at the same time, even though it does get requested in the 7 years or so I have been paying attention. Of course, that shouldn't stop you from submitting the feature request, that's just my observation.
    With regards to your specific situations of having a family catalog and a genealogy catalog, perhaps the workaround (and much preferred solution IMHO, which is another reason why I don't think Adobe will implement your suggestion) is to keep everything in a single catalog, with either tags or albums allowing you to segregate genealogy from family. Of course some photos might be in both; and then the problem of moving photos from catalog to catalog is eliminated.

  • Request for UI improvments and some more

    Hello Raptor Development Team,
    Your product is really good, but there are some obvious UI lacks and some possible improvements (sorry, if these lacks/improvements have been pointed before):
    1. There shall be possibility to search a text of a function/procedure/package/... without switching into Edit mode.
    2. In SQL*Worksheet by parse error no info is provided in which position in the statement - line, column - error has occurred (even SQL*Plus provides similar info). As far as I can remember it is limitation of error-processing of Oracle JDBC thin driver, but it can quite easily be overcome but re-parsing the same failed statement inside PL/SQL block by means of DBMS_SQL package which provides such info (and it is relatively cheap, as statement has anyway failed on parse).
    3. In SQL*Worksheet it should be possible to obtain all properties of an object under cursor by means of hotkey/popup menu (likewise the functionality of F4 button in TOAD) and not only by separate "describe" command (which, anyway, provide quite limited info).
    4. Navigation in the left explorer-like panel is quite cumbersome, especially when working with schemas with big amount of objects. It would be nice, if alternative interface (e.g. tabbed a-la TOAD) will be provided. The problem may be alleviated as well by providing in the left panel speedbars that allows to quickly switch between different connections and between DB object types (tables, views, procedures,...) in the same connection.
    5. If named bind variable is used in SQL*Worksheet and single statement is executed the "Enter bind value:" dialog box is shown for each bind variable as many times as it occurs in the statement (with empty "Object Value" field and "Object type reset to Varchar2 each time). Looks strange and inconvenient as it provide no clue for which occurrence of the variable value is asked.
    6. If the same statement with bind variable(s) is re-executed many times or several statements that refer to same bind variable are sequentially executed in "single-statement" mode that it would be really nice if values will be retained between executions and prompted in "Object Value" field of "Enter bind value:" dialog box.
    7. The following PL/SQL block fails
    declare
    x char(10);
    y char(10);
    begin
    select :a, :b into x,y from dual;
    end;
    8. This is not directly related to Raptor, but :). Spell-check on this forum does not know following words that shall be very popular here: JDBC, Varchar2, F4 and so on
    Yours sincerely,
    Oleksandr Alesinskyy

    1. Has been mentioned before - we do have a bug on it. To search across all your pl/sql, there is a report you can use.
    2. We are working on improving errors but I can't make any promises.
    3. We have heard this before but it won't be there for v1.0. You can use the Connections navigator to access the details of the objects that are accessible to you while you have a Worksheet open. You can even drag your Worksheet tab down to place it under the Connections details tab so you can see them both at the same time.
    4. In a post-v1.0 release, we will be looking at additional, alternate navigation.
    5. We have an open bug to not prompt you for the same bind more than once.
    6. I will talk to the Worksheet developer about this one. Not sure we can remember the binds from execution to execution but it would be a great enhancement.
    7. Not sure why this is failing - I will check into it.
    -- Sharon

  • Request For Enhancement: Cell Renderers: Is the Mouse In the Cell?

    I would like to propose an enhancement to Cell Renderers: add some way for Cell Renderers to know if the mouse is currently over the cell being renderered. Currently, Cell Renderers are told only if a cell is SELECTED or has FOCUS, which are not the same thing.
    This would be of great help especially for JTable and JTableHeader, where one could provide visual feedback as the mouse moves across cells, which could be a great help for the visually impaired.

    Hi, Marsian -
    You are absolutely right about adding methods to interfaces. My mistake.
    And you are also correct that what I propose would require that cells be repainted as the mouse enters or exits that cell's bounds. If this were to prove too expensive for some applications, the JComponents that use CellRenderers could have a property to enable or disable the behavior, for example setTrackMouseMovements(boolean). But when compared to what happens when you scroll a JTable, I cannot imagine this would be anywhere nearly as expensive, and the rendering that scrolling requires--all the cells that come into view within the viewport after scrolling--seems to work just fine.
    Heck, even when you select a cell, a whole lot of cells are re-rendered. Also, when a tooltip is currently visible, if you move the mouse, the CellRenderer is consulted for each and every mouse movement, even within the same cell!!!. This seems to work fine too. Would re-rendering a cell as the mouse enters or exits its bounds by anywhere nearly as expensive?
    But you write something that still confuses me. Are you saying that you create a new Component each and every time the getXXXRendererComponent() method of your CellRenderer is called? I don't understand why one would want to do this. Can you please help me out here?
    I would think that only one instance of each Component sub-class that the CellRenderer might return would be more than good enough. And I would think that these instances would be created in the CellRenderer's constructor. Certainly, the default CellRenderer classes do not create a new Component each time a cell needs to be renderered. In fact, most of them actually extend an extension of JComponent themselves, i.e. JLabel, and return "this". No CellRenderer I have ever written has ever created a Component each time a cell is rendered. That would be very expensive.
    But still, your point about altering interfaces is well taken. Too bad.
    There must be some solution to this problem. JTable could provide the cell coordinates of the cell in which the mouse currently resides, for instance, or it could have a method that indicates if the mouse is currently over a cell with given coordinates.
    Thanks,
    ---Mark

  • RFE..  request for enhancement  Unified Storage (ak)

    Hi,
    Maybe I've missed something, but is it any plans for possibility to enable krb5 as share options
    on a NFS-share? I would like to be able to do what I do on a "plain" opensolaris fileserver:
    1) uncomment krb5 lines in /etc/nfssec.conf
    2) #zfs set sharenfs=sec=krb5:krb5i:krb5p pool-0/local/filservertest/HOME
    What I'm trying to do, is denying none-kerberos-athenticated client to NFS (v4) mount anything at all.
    -espenM-
    I don't know where wlse to post this RFE....

    Espen wrote:
    I don't know where wlse to post this RFE....You should open a Service Request with Sun support. Then the support team can evaluate your request and log a RFE.

  • Request for enhancement/extension

    Good day!
    In reply to a post I made (sore eyes), I recevied the following reply:
    Re: sore eyes
    Posted: Jun 30, 2006 1:01 PM in response to: mrmotoqvq in response to: mrmotoqvq      
         Click to reply to this thread      Reply
    Please ask the JDev guys to add the Java METAL Look and Feel to the product.
    That would fix this.
    Is this the place to ask for this?

    This is the place to ask. You can also log an ER or Bug with Metalink if you have a Database Support contract. In due course we'll be giving you access to "SQL Developer Studio", an app where you can log this kind of request.
    Regards
    Sue

  • Isssue when collecting the transport request for a query and its elements

    Dear All,
    When collecting a query and its elements, only the query is getting collected in to the request and not the elements and I an error is getting displayed as You can not use request xxxxx and elements could not be saved. This is in bw 3.5.
    Can anyone suggest?
    Regards,
    Ram

    Hi,
    In the transport connection make sure that all the elements for the query which you need are manually checked.
    Just drop down the menu and see the elements of the query and check if they all are selected or not.
    Here you can also see if the elements are already present in some other TR.
    Just delete all those TR's before creating this new TR.So that these objects are unlocked or it will not added to your new TR niether it will give an error.
    Also make sure that all the elements have same data package and none of the query elements are assigned to temp package or any other package.
    Once you are sure that all the elements are checked and above told issues are corrected then only create the transport and release them.
    Thanks
    Ajeet

Maybe you are looking for

  • Songs don't show up on my iPad after applying them from iTunes. Help?

    I plug my iPad 2 into the computer and iTunes automatically comes up. When I go to apply a new playlist from iTunes to my iPad, it looks like it finishes loading and then it shows that I should have 181 songs on my iPad but i only see that I 31 songs

  • Using max function in PL/SQL

    VERY URGENT... Am new to oracle... I've written a package that display gif images in form of histogram/bar chart. using html, I need to use max function to display values proportionately. please help. i need to complete this assignment by 2/9/00 by 1

  • Macbook to macbook pro

    if i take my computer to the mac store and give my computer and the money, would you change it ?

  • SAP BOBJ XI 4.0 installation on AIX+oracle

    Hi, I want some information regarding SAP BO xi 4.0 AIX 6.1+oracle 10g installation Any konw how to install SAP BO Xi 4.1 on AIX+oracle. Please give the step how to implement crystal report+tomcat...  and soo many tools. amit

  • How to make tables in the mac mail?

    Hi Freinds I am using Macbook Pro, I wanted to create or Copy & Paste from Xcel Kindly guide the Easiest way to do this, Thanks in Advance, Dinesh.N