/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
return new AquaPopupMenuUI();
}
// Use the awt popup trigger code since this only runs on our OS!
return e.isPopupTrigger();
}
if (!(g instanceof Graphics2D)) {
super.paint(g, c);
return;
}
super.paint(g, c);
return;
}
// round off and put back edges in a new Graphics
// if any subsequent drawing occurs over these corners, the window is square again
super.paint(g, c);
}
// setup the graphics context to blast alpha for every primitive we draw
// draw the 3px round-rect line around the outer bounds of the window,
// this gives the appearance of rounded corners
}
// only get location on screen when necessary
final Point invokerCenter = new Point((int)invokerBounds.getCenterX(), (int)invokerBounds.getCenterY());
// invoker is "behind" the popup, no corners should be pointed
return;
}
// blast opaque background over the corners we want to "put back"
// popup is far right of invoker
// point upper left corner, most common case
return;
}
// point lower left corner
return;
}
// popup is far left of invoker
// point upper right corner
return;
}
// point lower right corner
return;
}
// popup is neither "far right" or "far left" of it's invoker
// popup is "middle" below it's invoker,
// this is probably the "connected" case where both upper corners should touch
return;
}
// if none of these cases match...don't make any corners pointed
}
}