mirror of
https://gitlab.com/biskuteri-cafe/JKomasto2.git
synced 2025-01-08 22:44:44 +01:00
Ran into design problem with timelines..
This commit is contained in:
parent
31277c7871
commit
ce22349538
@ -16,9 +16,9 @@ JKomasto {
|
||||
public
|
||||
JKomasto()
|
||||
{
|
||||
//new TimelineWindow().setVisible(true);
|
||||
new TimelineWindow().setVisible(true);
|
||||
//new ComposeWindow().setVisible(true);
|
||||
new PostWindow().setVisible(true);
|
||||
//new PostWindow().setVisible(true);
|
||||
}
|
||||
|
||||
// - -%- -
|
||||
|
@ -291,6 +291,8 @@ RepliesComponent extends JPanel {
|
||||
|
||||
int pages = 1 + ((replies.size() - 1) / 8);
|
||||
pageLabel.setText(pageNumber + "/" + pages);
|
||||
prevPage.setEnabled(pageNumber > 1);
|
||||
nextPage.setEnabled(pageNumber < pages);
|
||||
}
|
||||
|
||||
// ---%-@-%---
|
||||
|
@ -30,21 +30,22 @@ TimelineWindow extends JFrame {
|
||||
private TimelineComponent
|
||||
display;
|
||||
|
||||
// - -%- -
|
||||
|
||||
private static final Timeline
|
||||
NULL_TIMELINE = new Timeline();
|
||||
{
|
||||
NULL_TIMELINE.type = TimelineType.LOCAL;
|
||||
}
|
||||
|
||||
// ---%-@-%---
|
||||
|
||||
public void
|
||||
setTimeline(Timeline timeline)
|
||||
{
|
||||
if (timeline == null)
|
||||
{
|
||||
timeline = new Timeline();
|
||||
timeline.type = TimelineType.LOCAL;
|
||||
}
|
||||
|
||||
assert timeline != null;
|
||||
this.timeline = timeline;
|
||||
|
||||
// Here, we should request for posts for the timeline.
|
||||
// And pass data to TimelineComponent.
|
||||
}
|
||||
|
||||
// ---%-@-%---
|
||||
@ -93,6 +94,22 @@ TimelineComponent extends JPanel {
|
||||
private final List<PostPreviewComponent>
|
||||
postPreviews = new ArrayList<>();
|
||||
|
||||
// ---%-@-%---
|
||||
|
||||
public void
|
||||
setPosts()
|
||||
{
|
||||
/*
|
||||
* Okay, so timelines are infinite, unlike replies.
|
||||
* We can ask for a finite list of post preview data,
|
||||
* but we're the ones holding the pagination information?
|
||||
*
|
||||
* Or rather, we don't currently.. we should think out
|
||||
* timeline pagination, then have TimelineWindow hold
|
||||
* the data.
|
||||
*/
|
||||
}
|
||||
|
||||
// ---%-@-%---
|
||||
|
||||
TimelineComponent()
|
||||
|
Loading…
Reference in New Issue
Block a user