Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make m_axis field available to subclasses of AxisLabelLayout #4

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

brycecr
Copy link

@brycecr brycecr commented Aug 2, 2012

I was writing a subclass of AxisLabelLayout and the axis field is unavailable through any straightforward means. As far as I can tell, this is an omission and not a useful design choice, although I'm open to discussion on that point. The patch exposes m_axis conservatively; a public method might be reasonable.

@alex-rind
Copy link
Contributor

Thanks for the patch. I think the added method will be useful.

Did you encounter any other private fields in AxisLabelLayout that you
need for subclassing?

On 02.08.2012 06:42, brycecr wrote:

I was writing a subclass of AxisLabelLayout and this information is unavailable through any straightforward means. As far as I can tell, this is an omission and not a useful design choice, although I'm open to discussion on that point. The path exposes m_axis conservatively; a public method might be reasonable.

You can merge this Pull Request by running:

git pull https://github.com/brycecr/Prefuse master

Or you can view, comment on it, or merge it online at:

#4

-- Commit Summary --

  • Update src/prefuse/action/layout/AxisLabelLayout.java
  • Update src/prefuse/action/layout/AxisLabelLayout.java

-- File Changes --

M src/prefuse/action/layout/AxisLabelLayout.java (8)

-- Patch Links --

https://github.com/prefuse/Prefuse/pull/4.patch
https://github.com/prefuse/Prefuse/pull/4.diff


Reply to this email directly or view it on GitHub:
#4

@brycecr
Copy link
Author

brycecr commented Aug 2, 2012

Most of the other private members are exposed somehow, so I think that's the only issue I had with AxisLabelLayout. I did run into an issue in AxisRenderer where, in this snippet:

    AffineTransform origTransform = g.getTransform();
    AffineTransform transform = this.getTransform(item);
    if ( transform != null ) g.setTransform(transform);

g.setTransform(transform) should be g.transform(transform)

From the Graphics2D javadoc:
The setTransform method is intended only for restoring the original Graphics2D transform after rendering, as shown in this example:

// Get the current transform AffineTransform 
saveAT = g2.getTransform(); 
// Perform transformation 
g2d.transform(...); 
// Render 
g2d.draw(...); 
// Restore original transform 
g2d.setTransform(saveAT); 

I will push a commit for this bug momentarily

@brycecr
Copy link
Author

brycecr commented Aug 7, 2012

Similarly allowing programs to set the palette after a DataColorAction has been created has it's uses (as I found). The commits above deal with that

@brycecr brycecr closed this Aug 30, 2012
@brycecr brycecr reopened this Aug 30, 2012
@brycecr
Copy link
Author

brycecr commented Aug 30, 2012

Apologies, I'll take off the last cascaded table "fix" as that was testing code and doesn't function...my mistake...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants